Calling a WinAPI function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nicolasr

    #1

    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



  • Tom Shelton

    #2
    Re: Calling a WinAPI function


    "nicolasr" <nicolasrNOSPAM ATSIGNgmx.net> wrote in message
    news:Oe4V23rXDH A.1384@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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[/color]

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

    HTH,
    Tom Shelton


    Comment

    • nicolasr

      #3
      Re: Calling a WinAPI function

      thanks Tom,

      Nick


      Comment

      Working...