HighTechTalks DotNet Forums  

Re: GetCurrentProcessId import prblem

Dotnet Framework (Compact Framework) microsoft.public.dotnet.framework.compactframework


Discuss Re: GetCurrentProcessId import prblem in the Dotnet Framework (Compact Framework) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Maarten Struys
 
Posts: n/a

Default Re: GetCurrentProcessId import prblem - 07-08-2003 , 08:27 AM






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();







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.