Re: E_INVALIDARG for CoCreateInstance
Currently you are not aggregating. And I'd suggest you continue
on that path. Aggregation is not a common use COM technique.
It's useful for certain unorthodox and arcane utility tasks, but best
left untouched for regular COM development. If you feel you must
aggregate, I suggest you learn what it is about first from a good
COM book. "Inside COM" by Dale Rogerson should do. Then
you may find out you don't need it after all. Finally, if you still feel
you need to aggregate, see the COM_INTERFACE_ENTRY_AGGREGATE
macro. You need to pass GetControllingUnknown() as the second
argument. Note you call CoCreateInstance in your outer object's
FinalConstruct method _only_. And you can only aggregate in-proc
servers (CLSCTX_INPROC_SERVER) with the same threading model
as your outer object.
Microsoft MVP [VC], MCSD
MVP VC FAQ: http://vcfaq.mvps.org
"Donos" <firstname.lastname@example.org> wrote in message
I tried passing address of pointer, but it gives a exception.
But before going to the client side code. I have a doubt about
I am using CreateInstance function here to aggregate.
The 1st parameter of CreateInstance is the Outer IUnknown pointer.
So how should i use that?
Can anyone tell me how to use CreateInstance for aggregation?