--- mstools/samples/ole/srvrdemo/file.c 2018/08/09 18:20:49 1.1 +++ mstools/samples/ole/srvrdemo/file.c 2018/08/09 18:23:57 1.1.1.3 @@ -35,6 +35,7 @@ typedef struct CHAR rgfObjNums [cfObjNums+1]; } HEADER; +// BOOL GetFileSaveFilename (LPSTR lpszFilename); static VOID InitOfn (OPENFILENAME *pofn); static BOOL SaveDocIntoFile (PSTR); static LPOBJ ReadObj (INT fh); @@ -176,14 +177,14 @@ BOOL OpenDoc (VOID) fRevokeSrvrOnSrvrRelease = TRUE; EmbeddingModeOff(); - if (!CreateDocFromFile (szDoc, NULL, doctypeFromFile)) + if (!CreateDocFromFile (szDoc, 0, doctypeFromFile)) { MessageBox (hwndMain, "Reading from file failed.\r\nFile may not be in proper file format.", szAppName, MB_ICONEXCLAMATION | MB_OK); // We already revoked the document, so give the user a new one to edit. - CreateNewDoc (NULL, "(Untitled)", doctypeNew); + CreateNewDoc (0, "(Untitled)", doctypeNew); CreateNewObj (FALSE); return FALSE; } @@ -295,16 +296,17 @@ BOOL SaveDoc (VOID) */ BOOL SaveDocAs (VOID) { - CHAR szDoc[cchFilenameMax]; + CHAR szDoc[cchFilenameMax]; + BOOL fUpdateLater; CHAR szDocOld[cchFilenameMax]; - BOOL fUpdateLater = FALSE; // If document is embedded, give user a chance to update. // Save old document name in case the save fails. if (!GlobalGetAtomName (docMain.aName, szDocOld, cchFilenameMax)) ErrorBox ("Fatal Error: Document name is invalid."); - if (GetFileSaveFilename (szDoc)) + if (GetFileSaveFilename (szDoc)) + { if (docMain.doctype == doctypeEmbedded) @@ -445,7 +447,7 @@ static VOID InitOfn (OPENFILENAME *pofn) pofn->Flags = 0; pofn->hInstance = hInst; pofn->hwndOwner = hwndMain; - pofn->lCustData = NULL; + pofn->lCustData = 0; pofn->lpfnHook = NULL; pofn->lpstrCustomFilter = NULL; pofn->lpstrDefExt = szDefExt; @@ -528,3 +530,5 @@ BOOL GetFileSaveFilename (LPSTR lpszFile return FALSE; return TRUE; } + +