This article supporting source code
CRAs is an MFC class that encapsulates the remote Access service for Windows. The main advantage of this class is that you can connect to the Internet over a LAN, and you do not have to install RAS because the RAS DLLs are loaded dynamically.
The use of CRAs is very simple. Add the CRAs file to the project, create a CRAs class instance, and call its Initialize method.
BOOL cras::initialize
This call returns a Boolean value that indicates whether the initialization was successful. If False, most of the cases are because the RAS is not installed.
After the initialization is completed, CRAs gets the Windows Address book entry by calling the following member function and stores it in a private member variable for later use.
BOOL CRAS::GetEntryCount();
CString CRAS::GetEntry(ULONG ulIndex);
These two functions are useful, for example, you can use them to get a fill combo box or list box, and the user can select a dial-up entry.
If you need to dial or hang a line, you can use the following function:
BOOL CRAS::Dial (
CString sEntry,
CString sUserName,
CString sPassword,
CRASCallback pfnCallback,
CString sDomain );
BOOL CRAS::HangUp();
SEntry for dial-up Address book entry, sUserName and Spassword to log on to the network username and password, sdomain the parameters you must use to dial to a Windows NT dial-up server. A crascallback is a pointer to a callback function that is invoked when a RAS event (mostly a state change) occurs, and if it is not needed, it can set its value to null.