Click here to Skip to main content
15,891,649 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
valikac26-May-06 7:02
valikac26-May-06 7:02 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
followait26-May-06 12:00
followait26-May-06 12:00 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
valikac26-May-06 12:11
valikac26-May-06 12:11 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
followait26-May-06 23:10
followait26-May-06 23:10 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
valikac27-May-06 18:47
valikac27-May-06 18:47 
GeneralRe: AcceptEx and WSARecv question in IOCP Pin
followait27-May-06 20:25
followait27-May-06 20:25 
QuestionType Conversion Pin
satsumatable25-May-06 18:56
satsumatable25-May-06 18:56 
AnswerRe: Type Conversion [modified] Pin
Stephen Hewitt25-May-06 21:27
Stephen Hewitt25-May-06 21:27 
sivaprakashshanmugam wrote:
How can i convert this variant "VariantParam" paramter to my class type

 
The short answer:
 You can't; this isn't and shouldn't be possible. COM (and therefore ActiveX) is interface based and language neutral and as such doesn't know anything about C++ classes: all it knows about is COM interfaces. Let’s imagine what would happen is this was done: COM objects are meant to be able to be used by any (COM compliant) language - If your COM object required a C++ class as input how can a client of another language, such as VB, possibly use it?

The long answer:
 There are various hacks that can be used to work around this for inproc COM objects but they're dirty and result in a COM object that is only usable from C++. I'm not going to go into these techniques however because they are dirty hacks and there seems little point of going to the trouble of making a COM object but breaking the COM rules so you don't get the benefits of using COM; such as language neutrality.

The correct solution to this problem is to pass an interface to the method and don't expect to be able to pass a C++ object. You can make a C++ object which implements this interface (or a VB object that does for that matter).


Steve
GeneralRe: Type Conversion [modified] Pin
satsumatable26-May-06 17:01
satsumatable26-May-06 17:01 
GeneralRe: Type Conversion [modified] Pin
Stephen Hewitt26-May-06 17:46
Stephen Hewitt26-May-06 17:46 
Questionswap Red and Blue in GDI+ Pin
ilidan25-May-06 18:45
ilidan25-May-06 18:45 
AnswerRe: swap Red and Blue in GDI+ Pin
_anil_25-May-06 19:37
_anil_25-May-06 19:37 
GeneralRe: swap Red and Blue in GDI+ Pin
ilidan25-May-06 19:50
ilidan25-May-06 19:50 
GeneralRe: swap Red and Blue in GDI+ Pin
_anil_25-May-06 20:01
_anil_25-May-06 20:01 
GeneralRe: swap Red and Blue in GDI+ Pin
ilidan25-May-06 20:14
ilidan25-May-06 20:14 
Questionpointer [modified] Pin
jith - iii25-May-06 18:45
jith - iii25-May-06 18:45 
AnswerRe: pointer Pin
PJ Arends25-May-06 18:59
professionalPJ Arends25-May-06 18:59 
AnswerRe: pointer Pin
S. Senthil Kumar25-May-06 19:04
S. Senthil Kumar25-May-06 19:04 
GeneralRe: pointer Pin
jith - iii25-May-06 19:22
jith - iii25-May-06 19:22 
GeneralRe: pointer Pin
S. Senthil Kumar25-May-06 19:52
S. Senthil Kumar25-May-06 19:52 
GeneralRe: pointer [modified] Pin
jith - iii25-May-06 21:09
jith - iii25-May-06 21:09 
GeneralRe: pointer Pin
S. Senthil Kumar25-May-06 22:59
S. Senthil Kumar25-May-06 22:59 
GeneralRe: pointer [modified] Pin
jith - iii25-May-06 23:31
jith - iii25-May-06 23:31 
GeneralRe: pointer [modified] Pin
S. Senthil Kumar26-May-06 14:27
S. Senthil Kumar26-May-06 14:27 
GeneralRe: pointer [modified] Pin
jith - iii26-May-06 19:02
jith - iii26-May-06 19:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.