Thanks for the additional info.

I am compiling this DLL with VS 05 form the command line.  It uses a
manually created make file and not a project.

I didn't create the DLL, it is part of a package, which is why I am unclear
on some of this.

I searched the directory where all of the source is kept for both __stdcall
and __decl with no hits on either.  So I presume it uses whichever is
default for VS.

I guess I should ask why it matters?  Might the root of this problem be that
the wrong calling convention is used?  Or might I need to change someone in
my C# code based on the calling convention?

Thanks,
-Mont


On 4/27/07, Michael Waldinger <[EMAIL PROTECTED]> wrote:

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(r)  http://www.develop.com

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


===================================
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