// Stay Connectified // // Douglas Thrift // // $Id$ #include #include #include #include #pragma warning(disable: 4267) struct Exception { unsigned long code; Exception(unsigned long code) : code(code) {} }; template Type check(Type code) { if (code != 0) throw Exception(code); return code; } int main(int argc, char** argv) { RASDIALPARAMS params = { sizeof (RASDIALPARAMS), L"NETHOME Intranet VPN" }; int password; check(RasGetEntryDialParams(NULL, ¶ms, &password)); HRASCONN connection(NULL); check(RasDial(NULL, NULL, ¶ms, -1, NULL, &connection)); return 0; }