Microsoft KB Archive/181518

{|
 * width="100%"|

HOWTO: Programmatically Detect RAS Installation on Workstation

 * }

Q181518

-

The information in this article applies to:


 * Microsoft Windows 95
 * Microsoft Windows NT Workstation version 4.0

-

SUMMARY
This article shows how to programmatically detect if RAS is installed on a Workstation.

The sample code included in this article takes into account that RAS might not be installed, even if a copy of the Rasapi32.dll exists in the system directory. Also a valid phone book entry and an active modem are not required.

MORE INFORMATION
The way to detect programatically whether or not RAS is installed is to perform a LoadLibrary on the Rasapi32. If the LoadLibrary fails, RAS is not installed.

The following sample code demonstrates one way to do this. The function RasInstalled returns TRUE if RAS is installed and returns FALSE if RAS is not installed.

Sample Code
  #define WIN32_LEAN_AND_MEAN

#include   #include    #include    #include    #include    #include 

BOOL RasInstalled(void) {     HINSTANCE hDLL;      // Handle to DLL.

hDLL = LoadLibrary("rasapi32"); if (hDLL != NULL) { // RAS is installed. return TRUE; }     else { // RAS in not installed. return FALSE; }  } Additional query words:

Keywords : kbnetwork kbAPI kbOSWinNT400 kbRAS kbSDKPlatform kbOSWin95 kbGrpDSNet

Issue type : kbhowto

Technology : kbWinNTsearch kbWinNTWsearch kbWinNTW400 kbWinNTW400search kbWinNT400xsearch kbWin95search kbZNotKeyword3