|
-
February 14th, 2005, 05:05 AM
#21
Re: Instantiate abstract class
Hang on - CCollection is an interface ? Why didn't you make it IConnectionCollection or something.
I'm starting to get really confused here. Either CCollection is a class or it's an interface - one or the other. It can't be both. So which one is it ?
Oh and if you want more than one connection CoCreateInstance it from inside of your dll. That's the safest way of doing it.
There are other ways (like the static CComObject<>::CreateInstance) but this I would suggest is the best for you.
So why don't you have an IConnectionConnection interface to an CConnectionCollection class (created using the ATL wizard). Inside of this you'd have an array (as a member) containing IConnection interfaces. These will have been CoCreateInstanced by your CConnectionCollection class as and when it feels like it.
I really don't think you quite understand the difference between an interface and a COM object. A COM object isn't an interface. A COM object HAS interfaces.
Darwen.
Last edited by darwen; February 14th, 2005 at 05:15 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|