Because in you definition you only pass two arguments, while you need tree (an int, and to poiters).
It works while using the thiscall calling convention, because the interop layer passes as first argument an int for the this pointer
(three int's are reserved on the stack).
Willy.
> But I still dont understand why Thiscall works and the others dont.
>
[quoted text clipped - 106 lines]
> > > > > > > >
> > > > > > > > Thanks
Well its suppost to match up, its just something i typed in a hurry but it
is the same number of arguments in the definition and call. on teh real
code.
the dll definition would be
typedef SOMEVAL long
typedef SOME_ID long
SOME_ID someFn(SOMEVAL someVal, SOME_ID* someIDhere, SOME_ID* someIDhere2,
SOME_ID* someIDhere3);
so im calling with for example out of my memory
DllImport("somedll.dll", EntryPoint="blahFn",
CallingConvention=CallingConvention.ThisCall)]
public static extern int someFn(long someVal, ref someIDhere, ref long
someIDhere2, ref long someIDhere3);
// i know this should be int instead of long but curious why the long works
with thiscall and not the others or just not work at all.
long someVal;
long ID someID,
anotherID,
yetAnohterID,
andAnotherID;
someID = blahFn(someVal, ref anotherID, ref yetAnotherID, ref andAnotherID);
Only thiscall works, others dont, so if i understand it right I change the
definition from long to int for 32bit instead of the 64bit on the .net side,
and then i can use stdcall as normal.
> Because in you definition you only pass two arguments, while you need tree (an int, and to poiters).
> It works while using the thiscall calling convention, because the interop layer passes as first argument an int for the this pointer
[quoted text clipped - 112 lines]
> > > > > > > > >
> > > > > > > > > Thanks