Hi,
I've defined a function for a C++/CLI library:
extern "C"
{
INT_PTR __cdecl brl_graphics_Graphics(int Width, int Height, int Depth, int Hertz, int Flags);
}
And this is the function that calls it, it's just a wrapper:
IntPtr BlitzMax::BlitzMax::Graphics(int Width, int Height, int Depth, int Hertz, int Flags)
{
return IntPtr(brl_graphics_Graphics(Width, Height, Depth, Hertz, Flags));
}
When I call it from a C# application I get a AccessViolationException, for some reason in the disassembly it doesn't use cdecl calling convention:
push dword ptr [ebp+10h]
push dword ptr [ebp+0Ch]
push dword ptr [ebp+8]
mov ecx,dword ptr [ebp-4]
mov edx,dword ptr [ebp-8]
call FFD595B8
Thanks for helping in advance.