We help IT Professionals succeed at work.

VB Code to Dial RAS

Steve Groner
Steve Groner asked
on
Medium Priority
586 Views
Last Modified: 2012-06-27
Please do not send me the standard rundll32 solution it is not what I am looking for.  I need some code that demonstrates the RASDIAL API.  I am writing a little app that will dial a given DUN connection, returning status messages for me to put my own verbage to for display to the user.  After it dials the first connection it needs to dial another one.  It case you have not guessed it is for implementing VPN.  I downloaded the VB32RAS.EXE File and it is a little to complicated since the RAS_AUTO.DLL has its own form which returns the status messages.  I know someone else has done this, please help.
Comment
Watch Question

Commented:
sgroner,

  Since you have download the VB32RAS.exe, you could just get some code in the project Ras_auto.vbp to implement returning of the status message.

  What you need is the class RASError(Error.cls) and look at the code in event tmrGetConnStatus_Timer of frmAsyncDial. It use RasGetConnectStatus to get the status of existing RAS connection. If failed, use function fcnRASErrorString of class RASError to return the error. If succeed, get dwError code from type RASCONNSTATUS, then return meaningful message according to the code.

  Hope this help.

Commented:
sgroner,

  Since you have download the VB32RAS.exe, you could just get some code in the project Ras_auto.vbp to implement returning of the status message.

  What you need is the class RASError(Error.cls) and look at the code in event tmrGetConnStatus_Timer of frmAsyncDial. It use RasGetConnectStatus to get the status of existing RAS connection. If failed, use function fcnRASErrorString of class RASError to return the error. If succeed, get dwError code from type RASCONNSTATUS, then return meaningful message according to the code.

  Hope this help.

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Steve GronerLead Systems Engineer

Author

Commented:
Thanks Alot the code was great.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

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

OR

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.