<!-- Add the rest of your HTML here -->
This simple class for VC++ allows you to connection to Routing and Remote Access server running on Windows 2000. A connection can be made from the server locally, or using a remote Windows 2000 Client. It is possible to query when connected, the remote computers, users and their type of connections. This class also incorporates the ablity to disconnect any of the remote connections individually. Please note:
This class requires the MPRAPI.H
found on Microsoft's latest SDK. This must be linked into complier in the options of VC++. This class was only designed for Windows 2000. It may function at all under Windows XP but not under NT 4.0.
From information on the code see MSDN:RRAS - RASADMIN
How it works
Firstly, create the class object,
. Next use
if it's to query the local server.) This will return
for a good connection.
Secondly enumerate the connections using
. This fills the array,
with the username, computer name, remote ip address, port name, media type and how many seconds the client has been connected. In the array is the 'porthandle' value. This can be passed to the
and the connection 'n' will be terminated.
value returns the total number of current conections. Finally the
releases the connection to the RRAS server.
Updates in version 1.1
- The Class returns
CStrings instead of
- Continues to enumerate from the RRAS server after
ERROR_MORE_DATA error until it completes.
- Improved Casting of variables when passed or returned from the MPR API.
This is my first attempt for my years in writing C++ from my days in college using good ol' Turbo C. A sample application is available from i386.com Querying a RRAS Server from the command line. A GUI Application based on this class is now available to download from i386.com http://www.i386.com/default.asp?c=9&k=22&p=1548