473,386 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Calling a WinAPI function

Hi all,
can anyone provide an example on how to call the WinInet InternetDial()
function from
my CSharp code using DllImport?

The C declaration is as follows:

DWORD InternetDial(
HWND hwndParent,
LPTSTR lpszConnectoid,
DWORD dwFlags,
LPDWORD lpdwConnection,
DWORD dwReserved
);

(My main problem is the LPDWORD parameter)

thanks for any help,
Nick

Nov 15 '05 #1
2 6136

"nicolasr" <nicolasrNOSPAMATSIGNgmx.net> wrote in message
news:Oe**************@TK2MSFTNGP10.phx.gbl...
Hi all,
can anyone provide an example on how to call the WinInet InternetDial()
function from
my CSharp code using DllImport?

The C declaration is as follows:

DWORD InternetDial(
HWND hwndParent,
LPTSTR lpszConnectoid,
DWORD dwFlags,
LPDWORD lpdwConnection,
DWORD dwReserved
);

(My main problem is the LPDWORD parameter)

thanks for any help,
Nick


[DllImport("wininet.dll", CharSet=CharSet.Auto)]
public static int InternetDial (
IntPtr hwndParent,
string lpszConnectoid,
int dwFlags,
out int lpdwConnection,
int dwReserved);

HTH,
Tom Shelton
Nov 15 '05 #2
thanks Tom,

Nick
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: aarklon | last post by:
Hi folks, recently i read the book named assembly language step by step by Jeff Duntemann. in the chapter coding for linux, he has got a paragraph named C calling conventions, which he...
3
by: Webdiyer | last post by:
I want to integrate SecurID two-factor authentication system of the RSASecurity.inc into our asp.net application,but I get into trouble when trying to call the API functions of the ACE Agent,I got...
4
by: apm | last post by:
Is there a way to change the calling convention of a delegate to Cdecl? Is it possible to define a callback function in C# that used the Cdecl convention? Thanks in advance.
7
by: jg | last post by:
or would I have to use C# or C++?
0
by: Przemysław Bana¶ | last post by:
Hello! Can anyone help me with calling Novell function from dll? I think my main problem is in translating C variable types to C# types. Here is the code: using System; using...
1
by: Marek | last post by:
Hi I need to call a native function in a C++ dll from my C#. The C++ function declaration is shown below. The C# code that I have been trying to perform the call is also shown below. All it is...
1
by: Sriniv | last post by:
Hello all C-eers! I've heard oc calling convention. What is it really? I've seen some prefix words before function definitions. __stdcall, WINAPI, to name a few. What are these? Are they platform...
4
by: Henning M | last post by:
Hej All Im relativ new to VB.net and im trying to collect som device information using cfgmgr32.dll I use - Declare Function GetListLength Lib "cfgmgr32.dll" Alias...
0
by: Markus Eßmayr | last post by:
Hello! I'm writing a .NET component that forwards calls to it's functions on to an unmanaged DLL. This DLL is loaded dynamically using LoadLibrary and the function pointers are retrieved using...
1
by: bretta | last post by:
Hi I am trying to make a series of calls to an unmarshalled DLL. The header file for the DLL reads as follows: BOOL WINAPI InitUSB (void); BOOL WINAPI CloseUSB (void); BOOL WINAPI...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.