locked
RAS RRS feed

  • Question

  • 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

    Wednesday, December 14, 2005 6:44 PM

Answers

  • 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

    Thursday, December 15, 2005 2:31 AM
    Moderator

All replies

  • 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

    Thursday, December 15, 2005 2:31 AM
    Moderator
  • To clarify, there is not Managed Networking API support for RAS yet
    Thursday, December 15, 2005 6:35 AM