G
Guest
I would liek to create a window in C# and pass the handle and the hInstance
to an unmanaged c++ dll for some DirectX stuff. I have many iterations and
get nowhere. The HWND gets an null reference exception. The HINSTANCE in
the C++ is not the same as the C# instance. Anyway here was the latest
C++
__declspec(dllexport) void CvpCSILibApp::setWnd(HWND win);
__declspec(dllexport) void CvpCSILibApp::setHI(HINSTANCE win);
in the C# Wrapper DSWrapper
System.IntPtr
p=Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]);
DSWrapper.setHI(p);
and
DSWrapper.setWnd(myWin.Handle);
Any Help?
John
[ DllImport("vpCSILib.dll")]
public static extern void setWnd(System.IntPtr wnd);
[ DllImport("vpCSILib.dll")]
public static extern void setHI(System.Int32 wind);
In the C# implementation:
to an unmanaged c++ dll for some DirectX stuff. I have many iterations and
get nowhere. The HWND gets an null reference exception. The HINSTANCE in
the C++ is not the same as the C# instance. Anyway here was the latest
C++
__declspec(dllexport) void CvpCSILibApp::setWnd(HWND win);
__declspec(dllexport) void CvpCSILibApp::setHI(HINSTANCE win);
in the C# Wrapper DSWrapper
System.IntPtr
p=Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]);
DSWrapper.setHI(p);
and
DSWrapper.setWnd(myWin.Handle);
Any Help?
John
[ DllImport("vpCSILib.dll")]
public static extern void setWnd(System.IntPtr wnd);
[ DllImport("vpCSILib.dll")]
public static extern void setHI(System.Int32 wind);
In the C# implementation: