RAS

Hi,

I am writting application that uses the funcion RasDial ...
from some reason i am allways getting error in the return value
it is always 87...

the prototype is like this

[DllImport("rasapi32.dll",CharSet=CharSet.Auto)]

public extern static uint RasDial(IntPtr lpRasDialExtentoins,string phoneBook,RasDialParams lpRasDialParams,int dwNotifierType,RasCallBack lpNotifier,RASCONN lpRasConn);

the delegate is defined like this:

public delegate void RasCallBack(uint unMsg,RasConnectionState connectionState,int dwError);

and the usage is like this

RasDialParams dialParams; //Holds the RAS Dial parameters;

RasCallBack notifier;

RASCONN rasConn;

bool pass;

uint retVal;

//Retriving the dial parameters

dialParams = new RasDialParams();

dialParams.dwSize = Marshal.SizeOf(typeof(RasDialParams));

dialParams.szEntryName = m_name;

retVal = RASDialerResources.RasGetEntryDialParams(m_phoneBook, ref dialParams,out pass);

if(retVal != 0 )

{

throw new Exception("Could not get the dial parameters");

}

//Preforming the dial up

dialParams.szUserName = username;

dialParams.szPassword = password;

rasConn = new RASCONN();

rasConn.dwSize = Marshal.SizeOf(typeof(RASCONN));

notifier = new RasCallBack(PPPoEDialer.RasNotifier);

retVal = RASDialerResources.RasDial(IntPtr.Zero,m_phoneBook,dialParams,0,notifier,rasConn);

if(retVal!=0)

{

throw new Exception("Could not Start the ras dial");

}

m_rasHandle = rasConn.hrasconn;

hope that u can help me
Regards
Avishay



Answer this question

RAS

  • MSNasianuk

    To clarify, there is not Managed Networking API support for RAS yet

  • wingsalltheway19

    Getting the RAS to work properly is an art.
    Please post this question in the RAS forums or newsgroups.
    There is Managed Networking API support for RAS yet



  • RAS