07010209.txt 01-Jul-00


Need to be able to check if RAS DUN is installed in code

Hello All,

In my application to be run under 9x/NT I need to be able to
  determine if RAS/DUN is installed.  I don't wish to
  install it if they don't have it, I just need to know if
  it's not installed to be able to disable certain features
  of my application.  I've read through the messages and
  checked the docs but don't seem to see exactly what I'm
  looking for.  My only idea right now is to use
  RasEnumDevices and if no devices are enable then I can
  consider it not there, but according to the Win32 API doc
  this is only an NT thing.
Any Ideas thanks

Thanks,
James


James,

a very easy way to determine if RAS is installed (Win9x +
  NT) is to perform a LoadLibrary("rasapi32.dll"), if it
  returns NULL_PTR, RAS is not installed.

HTH
Frank


I had Hope and it vanished.
Under Win NT this is true if it's not installed then it does
  return NULL_PTR but under Windows 95 first release it
  loads.
I will have to dig up a Win 95 OSR2 and Windows 98 but I
  expect it to work similarly.
Under NT I have a way at least. My problem is that a third
  party DLL I have no choice but to use and it hurts my VO
  app if it fails to load properly since it needs RAS


James,

hmmm, I've just tested it under Win95 again and it works as
  expected.
Are you sure that the PC where you tested it _never_ had RAS
  installed?
I don't have a Win95 CD handy at the moment to test if
  installing and removing DUN again leads to different
  results than to have a PC where DUN never was installed
  but in the latter case it definitely works.
You can download a very helpful tool at
http://www.geocities.com/SiliconValley/Network/2041/
called ShowDep which shows you the dependencies (required
  DLLs...) of a particular file.
I would bet that all required files listed for rasapi32.dll
  are present on your system for what reason ever.

Cheers

Frank


Oops, forgot to mention that this is the way M$ recommends
  for determing if RAS is installed, look for Q181518 in the
  Knowledge Base (which should not mean that it has to work
  hehehe).

Cheers
Frank

James,

You could try this:
DEFINE INTERNET_RAS_INSTALLED := 0x10

_DLL FUNCTION InternetGetConnectedState(lpdwFlags AS PTR,;
  dwReserved AS DWORD) AS LOGIC ;
  PASCAL:WinInet.InternetGetConnectedState
LOCAL nFlags AS DWORD
  InternetGetConnectedState(@nFlags, 0)
  lRAS :=  IIF(_AND(nFlags,INTERNET_RAS_INSTALLED)>0, ;
    TRUE, FALSE)

Regards,
Lars-Eric