rmvprasad
asked on
com objects
Is it possible to create COM and DCOM objects using c++. I am not finding a documentation on the website. Every documentation given is given using VC++. Guide me where I can get an documentation.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Windows API has enough APIs to manipulate COM objects even in raw C.
VC++ is preferred because of ATL library - Collections, strings, components wizards usually simplify life.
VC++ is preferred because of ATL library - Collections, strings, components wizards usually simplify life.
1. Go to "Project->Add Reference...".
2. Choose the "COM" tab
3. Select or browse to the COM object you want, then click OK.
That's all you need to do (it works for DCOM too).
When you add the reference, Visual Studio will create a Runtime Callable Wrapper (RCW) which will allow you to use the component just as you would any other. There is a bit of overhead involved, however, so it's best to use .NET classes where available of course.