Api function

S

simon

In VB i have declaration for windows API function:

Private declare function timeGetTime Lib "winmm" () as Long

How can I do the same declaration in C#?

Where I can see API functions in Visual studio 2005 beta 2 and their
declarations?

Thank you,
Simon
 
R

robertino

You could help yourself by doing a search in this newsgroup - try
searching on "API function", for instance <g> and you'll get hundreds
of links.

One good tip you will find is to visit rhe
http://www.pinvoke.net/index.aspx website - this is truly awesome...

Best of luck,
Rob
 
G

Guest

[System.Runtime.InteropServices.DllImport("winmm", EntryPoint="timeGetTime",
ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi,
SetLastError=true)]
private static extern long timeGetTime();

--
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
Clear VB: Cleans up outdated VB.NET code
 
J

Jeff Louie

David... Please educate me on why one needs to explicitly declare the
entrypoint since you do not rename the method?

Regards,
Jeff

[System.Runtime.InteropServices.DllImport("winmm",
EntryPoint="timeGetTime",
ExactSpelling=true, CharSet=System.Runtime.InteropServices.CharSet.Ansi,
SetLastError=true)]
private static extern long timeGetTime();
 
S

simon

Thank you.

I was looking everywhere for this API function and I found it only in MSDN,
but without C# reference.

I download API viewer, but database of APIs I found (Win32api.txt) was
without this founction.

Can you tell me where you found this declaration or send me txt file with
API functions if I'll need something else in the future.

Thank you,
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top