PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Re: GetCurrentProcessId import prblem

Reply

Re: GetCurrentProcessId import prblem

 
Thread Tools Rate Thread
Old 08-07-2003, 12:27 PM   #1
Maarten Struys
Guest
 
Posts: n/a
Default Re: GetCurrentProcessId import prblem


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@contrigo.de> wrote in message
news:4thqt-6h.ln1@news.dt.contrigo.de...
> 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();
>
>
>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off