We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Please help me call DUN using RasApi32.dll functions?

bobban asked
Medium Priority
Last Modified: 2008-02-01
I need help calling RasApi32.dll functions...

I've found out these three declares but don't know how to use them, what constants to use or how I get those constants...

1) Dial:

Public Declare Function RasDial Lib "RasApi32.DLL" Alias "RasDialA" (lpRasDialExtensions As Any, ByVal lpszPhonebook As String, lprasdialparams As Any, ByVal dwNotifierType As Long, lpvNotifier As Long, lphRasConn As Long) As Long

2) Hangup

Public Declare Function RasHangUp Lib "RasApi32.DLL" Alias "RasHangUpA" (ByVal hRasConn As Long) As Long

3) Status

Public Declare Function RasGetConnectStatus Lib "RasApi32.DLL" Alias "RasGetConnectStatusA" (ByVal hRasConn As Long, lpRASCONNSTATUS As Any) As Long

Please!!!!! someone, look over these three declares and give me
a source-example I could use in my app.

If you'll do that, then "your an source-expert!"
you can sitate me on that one... :)

Thanks / Bobban
Watch Question

Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


Excellent!, but a sc-example would be even better...
Thanks anyway...
I call for you if I got problems, Ok?


How do I use RasEnumConnections to get the remote access connection
The RasEnumConnections function lists all active Remote Access Service (RAS) connections. It returns each connection's handle and phonebook entry name.
DWORD RasEnumConnections(

    LPRASCONN lprasconn,      // buffer to receive connections data
    LPDWORD lpcb,      // size in bytes of buffer
    LPDWORD lpcConnections      // number of connections written to buffer
Points to a buffer that receives an array of RASCONN structures, one for each RAS connection. Before calling the function, an application must set the dwSize member of the first RASCONN structure in the buffer to sizeof(RASCONN) in order to identify the version of the structure being passed.
Points to a variable that contains the size, in bytes, of the buffer specified by lprasconn. On return, the function sets this variable to the number of bytes required to enumerate the RAS connections.
Points to a variable that the function sets to the number of RASCONN structures written to the buffer specified by lprasconn.
Return Values
If the function succeeds, the return value is zero.
If the function fails, the return value is a nonzero error value listed in the RAS header file or one of ERROR_BUFFER_TOO_SMALL or ERROR_NOT_ENOUGH_MEMORY.
If a connection was made without specifying a phonebook entry name, the information returned for that connection will give the connection phone number preceded by ".".
See Also
RASCONN, RasEnumEntries, RasGetConnectStatus


Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.