How can i use COM Object in Vc++ or Vc++.NET?  
Author Message
Surezsu





PostPosted: Visual C++ General, How can i use COM Object in Vc++ or Vc++.NET? Top

Hi All,

I am having COM object that is "comgs.dll",which is the open source library,got from " http://www.hide-link.com/ ;.so,there is no " .LIB " file and " .h " file, only that website contain "comgs.dll" file. How can i avail in my new Vc++ project or Vc++.NET project.If you know please send any articles or sample codes....

Thanks.......


Visual C++12  
 
 
Simple Samples





PostPosted: Visual C++ General, How can i use COM Object in Vc++ or Vc++.NET? Top

It depends on whether you are using ATL and/or MFC or neither. I will assume you will use neither; you will be interfacing with the object directly.

There are multiple ways to do this, but among the most common is to use #import to import the type library. Look for #import in the documentation. When doing this, _com_ptr_t is used to create smart pointers. If you search for _com_ptr_t then you should be able to find documentation and samples. There are many samples for ADO that can be samples for use of other COM objects too.