--- mstools/samples/ole/clidemo/clidemo.c 2018/08/09 18:21:52 1.1.1.2 +++ mstools/samples/ole/clidemo/clidemo.c 2018/08/09 18:24:00 1.1.1.3 @@ -89,10 +89,9 @@ OLECLIPFORMAT vcfOwnerLink; / /*************************************************************************** * WinMain() - Main Windows routine ***************************************************************************/ - int APIENTRY WinMain( - HANDLE hInstance, - HANDLE hPrevInst, + HINSTANCE hInstance, + HINSTANCE hPrevInst, LPSTR lpCmdLine, INT nCmdLine ){ @@ -135,7 +134,7 @@ static BOOL InitApplication( / ){ //* LOCAL: WNDCLASS wc; //* temp wind-class structure - wc.style = NULL; + wc.style = 0; wc.lpfnWndProc = (WNDPROC)FrameWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; @@ -234,9 +233,9 @@ VOID ProcessCmdLine(LPSTR lpCmdLine) lstrcpy(szFileName, ofs.szPathName); } else - *szFileName = NULL; + *szFileName = 0; //* pass filename to main winproc - SendMessage(hwndFrame,WM_INIT,NULL,(LONG)NULL); + SendMessage(hwndFrame,WM_INIT,(WPARAM)0,(LPARAM)0); } @@ -271,10 +270,10 @@ LONG APIENTRY FrameWndProc( / //* used to avoid problems with OLE //* see the comment in object.h case WM_DELETE: //* user defined message - pItem = (APPITEMPTR) wParam; //* delete object + pItem = (APPITEMPTR) lParam; //* delete object WaitForObject(pItem); ObjDelete(pItem,OLE_OBJ_DELETE); - if (lParam) + if (wParam) cOleWait--; break; @@ -283,7 +282,7 @@ LONG APIENTRY FrameWndProc( / break; case WM_RETRY: //* user defined message - RetryMessage((APPITEMPTR)wParam, RD_RETRY | RD_CANCEL); + RetryMessage((APPITEMPTR)lParam, RD_RETRY | RD_CANCEL); break; case WM_INITMENU: @@ -643,7 +642,7 @@ static VOID MyOpenFile( / if (SaveAsNeeded(pFileName, *lhcptrDoc, lpStream)) { - *szNewFile = NULL; + *szNewFile = 0; if (!OfnGetName(hwndFrame, szNewFile, IDM_OPEN)) return; //* ERROR return @@ -685,7 +684,7 @@ static VOID SaveasFile( / ){ CHAR szNewFile[CBPATHMAX];//* new file name - *szNewFile = NULL; //* prompt user for new file name + *szNewFile = 0; //* prompt user for new file name if (!OfnGetName(hwndFrame, szNewFile, IDM_SAVEAS)) return; //* ERROR return //* rename document @@ -720,7 +719,7 @@ static BOOL SaveFile( / static CHAR szUntitled[CBMESSAGEMAX] = ""; int fh; //* file handle - *szNewFile = NULL; + *szNewFile = 0; if (!(*szUntitled)) LoadString(hInst, IDS_UNTITLED, (LPSTR)szUntitled, CBMESSAGEMAX); @@ -796,6 +795,7 @@ static BOOL LoadFile( / iObjectNumber = iObjectNumberHold; return FALSE; //* ERROR return } + _lclose(fh); return TRUE; //* SUCCESS return }