Can anybody suggest a link which provide step by step COM Class creation??

Can anybody suggest a link which provide step by step COM Class creation??
would be better if it explains with VS2010

Many thanks in advance
Don't do it manually (unless you have no alternative). Do you have access to ATL and the VS Wizard that creates ATL COM objects?
Thanks for your reply...

Yes I am using wizard only in VS2010, As I am newly learning COM technology. I am using wizard but getting some error at very initially about some macro. Just want to know what are ideal steps have to keep in mind while creating any COM application like...
1.Create interfaces.
2.Create class and implement those interfaces
3.Create Class factory class.
3.Register that component.
4. How client can access that functinality and so on...
I have read theory but want to know how practically does it work ...

Any link which provides any valuable information or you know some steps which need to fallow while creating COM then also welcome

Many thanks
Are you using ATL? Using COM is a miserable affair, but ATL makes the experience tolerable. The reason is COM is about dynamic binding, whereas C++ is about static binding. ATL uses templates to handle common code and provide a reasonable interface. If you have it, use it. If you don't, get it.

The ATL Wizard will create all the stuff you need and all you to add methods later. Whether you use a Factory or not isn't an ATL or Wizard issue. Don't create one if you don't need one.

Don't confuse the ATL Wizard with the MFC COM Wizard.
For a simple COM/ATL DLL

A Beginner Tutorial for Writing Simple COM/ATL DLL For VS2012

for a basic ActiveX control you can embed in a web page

ATL Tutorial


Also see:

ATL Concepts
Thank you Andy
Hello Andy!

I tried to follow steps which are mentioned in first link but there are some macros generated and compiler reporting error for the same.
I have followed first 7 steps and trying to compile.

error like in dllmain.h file

// dllmain.h : Declaration of module class.

class CsimpleATLCom_A1Module : public ATL::CAtlDllModuleT< CsimpleATLCom_A1Module >
public :

extern class CsimpleATLCom_A1Module _AtlModule;

error description like...

Error 1 error C2065: 'LIBID_simpleATLCom_A1Lib' : undeclared identifier c:\ajit data\com_pract\simpleatlcom_a1\simpleatlcom_a1\dllmain.h 6

not understanding this error

I am using vs2010

The LIBID is whatever the names is you used in the idl file. The example they give in the tutorial is

library SimpleATLComLib

so it ends up as LIBID_SimpleATLComLib

But you can check the .h file generated from the idl file to confirm this.

Topic archived. No new replies allowed.