Link to home
Start Free TrialLog in
Avatar of ccreel
ccreel

asked on

PowerBuilder Dialup Issue

I am writing a PB 5 app.  This app will be run on Win 95 machines at remote sites.  Right now the 95 clients have to click on the DUN connection and login to a NT 4 sp3 server.
Which maps a drive ( M: ).  What type of command or how can I get PB to automatically start a specific DUN session and close it when the app is closed?
Avatar of piano_boxer
piano_boxer

I dont know about PowerBuilder but here is how you do it in C:

Dial an existing intry in the phonebook.

HRASCONN hrasconn = NULL;

BOOL Connect()
{
    RASDIALPARAMS dp;
    dp.dwSize = sizeof(dp);
    strcpy(dp.szEntryName, "MyDialupConnection");
    dp.szPhoneNumber[0] = 0;  // Use phonenumber from phonebook
    dp.szCallbackNumber[0] = 0;
    strcpy(dp.szUserName, "MyUserName");
    strcpy(dp.szPassword, "MyPassword");
    dp.szDomain[0] = 0;
    dp.dwSubEntry = 0;
    dp.dwCallbackId = 0;

    if(RasDial(NULL, NULL, &dp, 0, NULL, &hrasconn)==0)
    {
        // Dialup succeeded
        return TRUE;
    }
    return FALSE;
}

// Now to hangup:

void Disconnect()
{
    if(hrasconn)
    {
        RasHangUp(hrasconn);
        hrasconn = NULL;
    }
}
Avatar of ccreel

ASKER

Thanks for the effort.  Sorry but I am looking for a way to do this with Power Builder 5.  The app is already under developement, so it must be finished with PB not C.

I need to know what Windows is looking for from an app to know to bring up a specific DUN session.  Any help on how to accomplish this from within a PB5 app would be helpful.
I am not familiar with Power Builder 5. Are you able to run an executable file (.exe)?
Avatar of ccreel

ASKER

Yes.  PB has the ability to run an EXE.  If you are going to suggest a specific exe to run, please also tell me what the exe is doing to bring up the link.  Thanks
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ccreel

ASKER

Chensu,
Perfect Answer.
Thanks for the help.
c