PC Review


Reply
Thread Tools Rate Thread

Api function

 
 
simon
Guest
Posts: n/a
 
      27th Sep 2005
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


 
Reply With Quote
 
 
 
 
Mark Rae
Guest
Posts: n/a
 
      27th Sep 2005
"simon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...

> How can I do the same declaration in C#?


1) Launch your Internet browser (e.g. Internet Explorer, FireFox, Opera,
Netscape etc)

2) Browse to http://www.google.com

3) Enter the text below in the box:

"C#" Windows API

4) Hit the button


 
Reply With Quote
 
robertino
Guest
Posts: n/a
 
      27th Sep 2005
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

 
Reply With Quote
 
=?Utf-8?B?RGF2aWQgQW50b24=?=
Guest
Posts: n/a
 
      27th Sep 2005
[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


"simon" wrote:

> 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
>
>
>

 
Reply With Quote
 
Jeff Louie
Guest
Posts: n/a
 
      27th Sep 2005
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();


*** Sent via Developersdex http://www.developersdex.com ***
 
Reply With Quote
 
simon
Guest
Posts: n/a
 
      28th Sep 2005
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


"Jeff Louie" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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();
>
>
> *** Sent via Developersdex http://www.developersdex.com ***



 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Function Question: Collect Condition in Dialog Box - But How toInsert into Function Equation? SteveM Microsoft Excel Programming 1 3rd Jan 2008 03:45 PM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft Dot NET Framework 1 22nd Nov 2007 11:36 AM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft ADO .NET 3 22nd Nov 2007 09:17 AM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft VB .NET 0 20th Nov 2007 04:24 AM
I have a CLR function thet returns IEnumberable (a table) and it has a FillRow function. I am returning 10,000 integers from this function. Is there any way that I can preallocate the resulting table or give SQL server hint as to how many rows my fun DR Microsoft Dot NET 0 20th Nov 2007 04:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:10 PM.