home *** CD-ROM | disk | FTP | other *** search
-
- #include <objbase.h>
- #include "lst41c.h"
- #include <stdio.h>
-
-
- CLst41* g_pLst41 = NULL;
-
- void main()
- {
- MSG msg;
- DWORD g_dwLst41CF = 0;
- HRESULT hr;
-
- IClassFactory* pcf;
-
- if((hr = OleInitialize(NULL)) != S_OK)
- {
- printf("OleInitialize Failed [0x%x]\n", hr);
- return;
- }
-
- if((g_pLst41 = CLst41::Create()) == NULL)
- return;
-
- pcf = CLst41CF::Create();
- if (pcf == NULL)
- goto Clean;
-
- hr = CoRegisterClassObject(CLSID_CLst41,
- pcf,
- CLSCTX_LOCAL_SERVER,
- REGCLS_MULTIPLEUSE,
- &g_dwLst41CF);
-
- if (hr != NOERROR)
- goto Clean;
-
- pcf->Release();
-
- while(GetMessage(&msg, NULL, NULL, NULL))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
-
- Clean:
- if(g_dwLst41CF != 0)
- CoRevokeClassObject(g_dwLst41CF);
-
- if (g_pLst41 != NULL)
- g_pLst41->Release();
-
- OleUninitialize();
- }
-
-
-
-