ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/StayConnectified/StayConnectified.cpp
Revision: 447
Committed: 2005-05-14T04:59:06-07:00 (20 years, 1 month ago) by douglas
File size: 657 byte(s)
Log Message:
Woof!

File Contents

# Content
1 // Stay Connectified
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #include <windows.h>
8 #include <shellapi.h>
9 #include <ras.h>
10 #include <raserror.h>
11
12 #pragma warning(disable: 4267)
13
14 struct Exception
15 {
16 unsigned long code;
17 Exception(unsigned long code) : code(code) {}
18 };
19
20 template <typename Type>
21 Type check(Type code)
22 {
23 if (code != 0)
24 throw Exception(code);
25
26 return code;
27 }
28
29 int main(int argc, char** argv)
30 {
31 RASDIALPARAMS params = { sizeof (RASDIALPARAMS), L"NETHOME Intranet VPN" };
32 int password;
33
34 check(RasGetEntryDialParams(NULL, &params, &password));
35
36 HRASCONN connection(NULL);
37
38 check(RasDial(NULL, NULL, &params, -1, NULL, &connection));
39
40 return 0;
41 }

Properties

Name Value
svn:eol-style native
svn:keywords Id