Click here to Skip to main content
13,344,281 members (54,537 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 6 Apr 2002

CRRAS v.1.1 for Routing and RAS (RRAS) server under Windows 2000

, 30 Jun 2003
Rate this:
Please Sign up or sign in to vote.
Connect, query and terminate connections on a Windows 2000 RRAS Server
<!-- 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 and MPRAPI.LIB 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, CRRAS RRasServer. Next use RRasServer.Connect("MYSERVER") or RRasServer.Connect(""). (Use NULL if it's to query the local server.) This will return TRUE for a good connection.

Secondly enumerate the connections usingRRasServer.list(). This fills the array, RRasServer.client[n] 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 RRasServer.terminate(client(n).porthandle) and the connection 'n' will be terminated.

Also the RRasServer.connectedclients() value returns the total number of current conections. Finally the RRasServer.disconnect() releases the connection to the RRAS server.

Updates in version 1.1

  • The Class returns CStrings instead of chars
  • 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 Querying a RRAS Server from the command line. A GUI Application based on this class is now available to download from


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author
Software Developer (Senior)
Austria Austria
Programmer, Cook, Photographer I guess that's me.

You may also be interested in...


Comments and Discussions

QuestionHow to setup RAS Server in XP Pro Pin
captainc/c++30-Jun-08 20:40
membercaptainc/c++30-Jun-08 20:40 
Hi ,
I would like to know how to set up RAS Server in XP Pro, I am using VC++ 2005. And later I would to connect to my RAS Server using modem. To connect I'd use the client program in Code Project to test it.

Any idea?


~God Bless The Internet~

AnswerRe: How to setup RAS Server in XP Pro Pin
i386.com30-Jun-08 21:41
memberi386.com30-Jun-08 21:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 1 Jul 2003
Article Copyright 2002 by
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid