"Rory Plaire" <Ro********@discussions.microsoft.comwrote in message
news:0F**********************************@microsof t.com...
After searching and experimentation, I found the note in the remarks
section
of the MSDN doc on Marshal::GetDelegateForFunctionPointer
(http://msdn2.microsoft.com/en-us/lib...onpointer.aspx)
-
You cannot use this method with function pointers obtained through
C++...
Why not?
Calling convention, I would guess. That method probably assumes stdcall,
while C++ uses thiscall except for variable length argument lists which use
cdecl.
It also mentions that you can't use a function pointer to a managed method,
and if you compile your C++ code with /clr then chances are your C++
functions are MSIL (managed).