Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

CreateObject equivalent in Visual C++

$
0
0

Good evening,

I read the top related threads above and I have found this one http://social.msdn.microsoft.com/Forums/vstudio/en-US/1e7b83c3-6882-4dd4-80cc-b14f7ff2598d/c-comole-equivalents-of-createobject-and-getobject?forum=exceldev that might help me to clear my doubts. Unfortunately I am new in using of COM in C++ and so I need a more accurate explanation.

In the topic above I have found these lines of code:

// Initialize COM for this thread...
   CoInitialize(NULL);

   // Get CLSID for our server...
   CLSID clsid;
   HRESULT hr = CLSIDFromProgID(L"Excel.Application", &clsid);

There I didn't understand very well what hr is (and I imagine you could explain me what it is), but, however, my main problem is the translation of these lines of code, from VB to C++:

Set I = New UNI
I.test()

I hope you guys could help me to understand all that stuff and to find a solution to my problem.
I am not a native speaker, so I would prefer if you could write me an example with a summarized explanation.
Thank you very much,

Giovanni



Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>