views:

636

answers:

3

We have a modem terminal application written in VB6. It works great for what we need it to do, but there is a new requirement to initiate a VPN connection when dialing a particular provider. I've looked over some related posts and it looks like this may be possible using the RAS API. Can anyone suggest resources/advice for working with this API beyond MSDN?

Difficulty - .NET is not an option.

+1  A: 

Is .Net completely not an option or is it not an option to switch everything you have into .Net? You could create a .Net class library and enable COM+ and then use the library in your existing VB6 application.

Apologies if this isn't an option either.

Spencer Ruport
Solid suggestion, but no .NET at all.
cmsjr
+1  A: 

In worse case where you only find .NET examples I would use .NET Reflector to see what APIs the .NET framework is calling and what parameters it is passing. I did this when I was trying to use GDI+ in VB6. A algorithm worked great in .NET but failed badly when I used the direct API in VB6. Using reflector I found the parameter I was messing up and then it started to work.

RS Conley
+1  A: 

This may not be as robust as you need, but I have called out to the system rasdial command in the past for simple situations where I needed to setup a VPN connection.

USAGE:
        rasdial entryname [username [password|*]] [/DOMAIN:domain]
                [/PHONE:phonenumber] [/CALLBACK:callbacknumber]
                [/PHONEBOOK:phonebookfile] [/PREFIXSUFFIX]

        rasdial [entryname] /DISCONNECT

        rasdial

Not industrial strength, but good to use in scripts and such.

Jeremy
I was hoping for more control, but willsettle for works ;)
cmsjr
I am sure that someone somewhere has wrapped this API using COM/ActiveX. Depending on your desire/ability to pay, you could get more control that route. Otherwise, I think you may be stuck creating your own wrapper from VB. :)
Jeremy