I am writing an ATL project and I am wondering how can I create classes here. Right now I have one class created by Add / Class / ATL Simple Object . I want to divide it into smaller classes, but the method from these classes should use CComPtrand have CComPtras an argument. I cannot create a βsimpleβ C ++ class because I do not CComPtr.
Should I create ATL classes using the ATL Simple Object Wizard and then use the interface for this class to call methods. Like here:
CComPtr<ITestAtlClass> tptr;
tptr.CoCreateInstance(CLSID_TestAtlClass);
tptr->test();
And should I add all public methods using Class View / ITestAtlClass / Add / Add Method ? What about the constructors? Do I need to initialize my class only by properties (and add them through Class View / ITestAtlClass / Add / Add property )? And pass each com object using the IUnknown interface?
Can someone tell me how this should be done in the ATL project. I will use these smaller classes internally (no one will create these classes outside my DLL) to make my code more readable.
source
share