The "calling convention" they are asking for can be a build setting or
specified in the source code.  You don't seem to specify yours in the
source code, so it is probably in the build settings.  Common calling
conventions are __stdcall and __cdecl.  If you are using Visual Studio to
build the C code it will be under Properties | C/C++ | Advanced | Calling
Convention.

I have a project that is used successfully via P/Invoke and it is __cdecl.
I believe the calling convention has to be __cdecl for the PInvoke to work,
but I may be wrong about that.

For the record, I have had problems getting the return value back.  The
eturn value of mine is a bool type, and it always returns false when called
via P/Invoke (it will return the expected true/false when called from my
unit test harness which is also written in unmanaged C++).  I am
successfully retrieving an out parameter which is a pointer to a char
buffer array.  That isn't of much use to you since I am marshalling the
buffer using the StringBuilder object; I don't know what the procedure
would be for marshalling an out parameter that is a struct.

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to