I have a C++ class that I need to wrap up in a COM (ATL) object. After a
little initial reading/investigation, this seems to be not too much of
an issue - however, my class has no default ctor - i.e. all its ctors
require one or more arguments (in one case - a ctor takes a C++
reference) - so far I haven't seen an example where a COM class's ctor
takes arguments (let alone a C++ reference) - can this be done? if yes, how?
Any pointers/links would be appreciated
Ralph - 27 Jul 2007 14:07 GMT
> I have a C++ class that I need to wrap up in a COM (ATL) object. After a
> little initial reading/investigation, this seems to be not too much of
[quoted text clipped - 3 lines]
> takes arguments (let alone a C++ reference) - can this be done? if yes, how?
> Any pointers/links would be appreciated
Quick 'n dirty response...
You will have to provide a default.
COM uses only OLE Types. Well you can fake a few using Variants and such,
but best not to go there as you will destroy the basics of "COM" - binary
independance.
Use and play with the ATL Wizard. It will do much of the work for you and
provide a good example of how it all works. After you are comfortable - then
you can start bending the rules. <g>
But more importantly you are in the wrong newsgroup. This one is for users
of Classic VB and COM. You might try one of the VC++ ones.
-ralph