- Timestamp:
- May 10, 2000, 3:12:46 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comdlg32/filedlg95.c
r3363 r3511 1 /* $Id: filedlg95.c,v 1. 8 2000-04-10 17:48:06 cbratschiExp $*/1 /* $Id: filedlg95.c,v 1.9 2000-05-10 13:12:46 sandervl Exp $*/ 2 2 /* 3 3 * COMMDLG - File Open Dialogs Win95 look and feel … … 350 350 LPCSTR lpstrFilter = NULL; 351 351 LPSTR lpstrCustomFilter = NULL; 352 LPWSTR lpstrFile = NULL; 353 LPWSTR lpstrInitialDir = NULL; 354 LPWSTR lpstrTitle = NULL; 352 355 DWORD dwFlags; 353 356 … … 420 423 fodInfos->DlgInfos.dwDlgProp = 0; 421 424 425 /* allocate ansi filename buffer */ 426 lpstrFile = ofn->lpstrFile; 427 ofn->lpstrFile = MemAlloc(ofn->nMaxFile); 428 429 // convert initial dir & title (if necessary) 430 lpstrInitialDir = (LPWSTR)ofn->lpstrInitialDir; 431 if(lpstrInitialDir) { 432 ofn->lpstrInitialDir = MemAlloc(lstrlenW(ofn->lpstrInitialDir)+1); 433 lstrcpyWtoA((LPSTR)ofn->lpstrInitialDir, lpstrInitialDir); 434 } 435 lpstrTitle = (LPWSTR)ofn->lpstrTitle; 436 if(lpstrTitle) { 437 ofn->lpstrTitle = MemAlloc(lstrlenW(ofn->lpstrTitle)+1); 438 lstrcpyWtoA((LPSTR)ofn->lpstrTitle, lpstrTitle); 439 } 440 422 441 switch(iDlgType) 423 442 { … … 452 471 fodInfos->ofnInfos->hInstance = hInstance; 453 472 MemFree((LPVOID)(fodInfos)); 473 474 /* filename */ 475 lstrcpynAtoW(lpstrFile, (LPCSTR)ofn->lpstrFile, ofn->nMaxFile); 476 MemFree(ofn->lpstrFile); 477 ofn->lpstrFile = lpstrFile; 478 479 //free converted initial dir & title strings 480 if(lpstrInitialDir) { 481 MemFree((LPVOID)ofn->lpstrInitialDir); 482 ofn->lpstrInitialDir = (LPCWSTR)lpstrInitialDir; 483 } 484 if(lpstrTitle) { 485 MemFree((LPVOID)ofn->lpstrTitle); 486 ofn->lpstrTitle = (LPCWSTR)lpstrTitle; 487 } 454 488 return ret; 455 489 }
Note:
See TracChangeset
for help on using the changeset viewer.