Hey,
I'm trying to write a dll which can receive input from mIRC. In mIRC helpt its specified that i need a method with the following signature:
int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
How do I "convert" that c++ signature into a c# method ?
Thanks
Loading
AlanPosted Aug 5, 2007, 7:22 AM
If that function is contained in a dll called mIRC.dll, let's say, then I'd try this signature:
using System.Runtime.InteropServices;
[DllImport("mIRC.dll")]
public static extern int procname(IntPtr mWnd, IntPtr aWnd, string data, string parms, int show, int nopause);
There should be no need to specify the _stdcall calling convention as that is the default in C#.
You might be able to use 'bool' rather than 'int' for the last 2 parameters but I'm always a bit nervous of using the former (1 byte in C#) as BOOL in C is a typedef for a 4 byte integer.