I wonder if your declarations are right: GetCurrentProcessId returns a DWORD
so I would declare it as:
[DllImport("coredll.dll")]
public static extern unsigned int GetCurrentProcessId();
and GetCurrentProcess returns a HANDLE, so I would declare it as:
[DllImport("coredll.dll")]
public static extern IntPtr GetCurrentProcess();
If it is still not working you should follow Neil's suggestion and provide
us with some sample code.
--
Regards,
Maarten Struys
PTS Software bv
----
"Timo Meier" <t.meier (AT) contrigo (DOT) de> wrote
Quote:
Hi, i want to import the following function but i always get an Exception:
System.MissingMethodException
What is wrong?
[DllImport("coredll.dll")]
public static extern int GetCurrentProcessId();
[DllImport("coredll.dll")]
public static extern int GetCurrentProcess(); |