I hope someone can help me with this, I'm mostly a C# developer so my C and C++ skills are bad. I have a native C dll that is a plugin of a larger application. I cross compile this dll for windows on linux using gcc.
In the native dll when I create a D3DSurface I want to call a function in a Mixed Mode C++ dll and pass in the pointer to the surface along with a Hwnd/handle. That Mixed Mode C++ should then call my C# managed code.
As an example, in C I want to do the following;
Hwnd handle;
LPDIRECT3DSURFACE d3dtarg;
SurfaceCreated(handle, d3dtarg);
In C# I want this called from the mixed mode assembly
public static class D3DInterop
{
public static void SurfaceCreated(IntPtr handle, IntPtr surface)
{
//do work
}
}
Since I suck at C++, I just want to know if someone can give me an example of what I need to code for the mixed mode dll. I'd also like to not have to compile the mixed mode dll with directx headers, so is there a way I can cast the 'C' LPDIRECT3DSURFACE into a generic pointer? In C# I just use the IntPtr anyway.