C++ Interop


Urs Vogel


What could be the cause for the following effect below, where the char* str
pointer points to the wrong address (app. minus 1 byte)? I use __cdecl
calling conventions and default struct alignment:

managed code:

s = MyFunc((__int32)10, (char *)"MyString");

unmanaged code:

short MyFunc(__int32 P1, char *str)
// here, str = "-MyString" ...
return 0;

Is this some project setting which I missed, or a missing pre-processor or
linker directive?

Any hints are appreciated.

Thanks, Urs


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads