Calling a WinAPI function

  • Thread starter Thread starter nicolasr
  • Start date Start date
N

nicolasr

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
 
nicolasr said:
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
 
Back
Top