19 |
|
|
20 |
|
#ifndef _WIN32 |
21 |
|
inline string fix(const string& ansi) { return ansi; } |
22 |
< |
inline void munge(void) { return; } |
22 |
> |
inline void munge(void) { debug = true; } |
23 |
|
#else |
24 |
|
inline string fix(const wstring& wide) |
25 |
|
{ |
65 |
|
} |
66 |
|
#endif |
67 |
|
|
68 |
+ |
#ifdef _WIN32 |
69 |
|
int CALLBACK selector(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); |
70 |
|
|
71 |
|
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR |
73 |
|
{ |
74 |
|
int argc; |
75 |
|
unsigned short** argv = CommandLineToArgvW(GetCommandLineW(), &argc); |
76 |
+ |
#else |
77 |
+ |
int main(int argc, char* argv[]) |
78 |
+ |
{ |
79 |
+ |
#endif |
80 |
|
|
81 |
|
string error; |
82 |
|
string file = "svrcfg_cnc.ini"; |
101 |
|
{ |
102 |
|
error = "The argument -file must be followed by a filename."; |
103 |
|
|
104 |
+ |
#ifdef _WIN32 |
105 |
|
MessageBox(NULL, error.c_str(), "Bad Arguments", MB_ICONERROR); |
106 |
+ |
#endif |
107 |
|
return 1; |
108 |
|
} |
109 |
|
} |
110 |
|
} |
111 |
|
|
112 |
+ |
#ifdef _WIN32 |
113 |
|
GlobalFree(argv); |
114 |
+ |
#endif |
115 |
|
|
116 |
|
if (debug) cerr << "file = " << file << "\n"; |
117 |
|
|
120 |
|
{ |
121 |
|
error = "Could not open " + file + "."; |
122 |
|
|
123 |
+ |
#ifdef _WIN32 |
124 |
|
MessageBox(NULL, error.c_str(), "Bad File", MB_ICONERROR); |
125 |
+ |
#endif |
126 |
|
return 1; |
127 |
|
} |
128 |
|
|
129 |
+ |
#ifdef _WIN32 |
130 |
|
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAP_SELECTOR), NULL, selector); |
131 |
+ |
#endif |
132 |
|
|
133 |
|
delete config; |
134 |
|
|
135 |
+ |
#ifdef _WIN32 |
136 |
|
if (debug) |
137 |
|
{ |
138 |
|
cout << "Press enter key to exit . . ."; |
139 |
|
cin.get(); |
140 |
|
} |
141 |
+ |
#endif |
142 |
|
|
143 |
|
return 0; |
144 |
|
} |
145 |
|
|
146 |
+ |
#ifdef _WIN32 |
147 |
|
int CALLBACK selector(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) |
148 |
|
{ |
149 |
|
switch (uMsg) |
351 |
|
|
352 |
|
return false; |
353 |
|
} |
354 |
+ |
#endif |