atl - create instance

stassaf
stassaf used Ask the Experts™
on
hi,
my com atl uses one atl object that has an interface.
this object should return some recordset to the client.
i want to use a regular class that will handle all the recordset creation, so i added a class to the project that creates a recordset.
now i want to create an instance of the regular class from my atl object in order to create the recordset.
i've tried some examples:
1.
  CComObject<systemRecordset> * pConn;
  CComObject<systemRecordset>::CreateInstance (&pConn);

2.
  in another example i saw usage of CComCoClass

what's the correct way to do it?
10x,
Assaf
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
to create an instance of a regular class,
systemRecordset * pConn = new systemRecordset
should be quite enough.
or am I misreading the question?

Author

Commented:
yes, you are right, i've made a mistake
and created an atl class instead of a regular class.
but still if i have 2 atl classes and i want to create an instance of one class from the other, what's the correct syntax?

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial