I have one com server with some interfaces exposing some API's
COM class looks like below
class ATL_NO_VTABLE CTask :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CTask, &CLSID_Task>,
public ITask
{
public:
STDMETHOD (Task)();
STDMETHOD (ABC)();
...
}
Now this com server also contains one more class XYZ
ABC API needs to call XYZ functionality
STDMETHODIMP ABC()
{
XYZ xyz;
xyz.dosomething();
}
dosomething function need to call com server Task function, like below
class XYZ
{
public:
void dosomething()
{
// need to call Task function
}
};
How can this be done? Do I need to CoCreateInstance ITask in dosomething?
I tried creating CTask taskl; in dosomething but it gave some errors.