This project is read-only.

RasConnState message

Mar 29, 2011 at 2:13 PM
Edited Mar 29, 2011 at 2:14 PM

I'm looking for a way to get the full state message for RasConnState from Windows. Of course I can do it like the code below, but I suppose the messages are in Windows somewhere and translated per language of the installed Windows. How can I retrieve them?

string GetRasConnStateMsg(RasConnectionState state)
Switch (state)
  case RASCS_OpenPort:
 	return "Opening Port...";
  case RASCS_PortOpened:
	return "Port Opened...";
  case RASCS_ConnectDevice:
	return "Dialing...";
Mar 29, 2011 at 4:54 PM

Unfortunately I don't think Microsoft exposed that part of the API, it's specific to their user interface when dialing connections. As far as I know RasGetErrorString is the only API that converts values to localized strings, but it only handles error codes... doesn't do anything with connection states.