Rev 85 | Rev 116 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 85 | Rev 87 | ||
|---|---|---|---|
| Line 35... | Line 35... | ||
| 35 | int array_index; |
35 | int array_index; |
| 36 | char *endptr; |
36 | char *endptr; |
| 37 | wchar_t app_pathname[MAX_PATH]; |
37 | wchar_t app_pathname[MAX_PATH]; |
| 38 | wchar_t font_pathname[MAX_PATH]; |
38 | wchar_t font_pathname[MAX_PATH]; |
| 39 | wchar_t temp_string[100]; |
39 | wchar_t temp_string[100]; |
| 40 | struct _stat fileinfo; |
- | |
| 41 | 40 | ||
| 42 | // save application instance |
41 | // save application instance |
| 43 | hAppInstance = hInstance; |
42 | hAppInstance = hInstance; |
| 44 | 43 | ||
| 45 | // find module and path names, and *IMPORTANT*, set the current working directory there |
44 | // find module and path names, and *IMPORTANT*, set the current working directory there |
| Line 246... | Line 245... | ||
| 246 | while (*lpCmdLine == '"') |
245 | while (*lpCmdLine == '"') |
| 247 | lpCmdLine++; // skip leading quotes |
246 | lpCmdLine++; // skip leading quotes |
| 248 | if ((endptr = strchr (lpCmdLine, '"')) != NULL) |
247 | if ((endptr = strchr (lpCmdLine, '"')) != NULL) |
| 249 | *endptr = 0; // break the string at the first ending quote |
248 | *endptr = 0; // break the string at the first ending quote |
| 250 | 249 | ||
| 251 | // is it a file that exists ? |
250 | // is it a file that exists ? (don't use stat() which is broken on WinXP) |
| 252 | if ( |
251 | if (_access (lpCmdLine, 0) == 0) |
| 253 | { |
252 | { |
| 254 | ConvertToWideChar (load_pathname, WCHAR_SIZEOF (load_pathname), lpCmdLine); // save pathname string |
253 | ConvertToWideChar (load_pathname, WCHAR_SIZEOF (load_pathname), lpCmdLine); // save pathname string |
| 255 | is_dialogbox_load_validated = true; // and act as if the user just validated a load dialog box |
254 | is_dialogbox_load_validated = true; // and act as if the user just validated a load dialog box |
| 256 | } |
255 | } |
| 257 | #ifndef NDEBUG |
256 | #ifndef NDEBUG |