merged tag ooo/OOO330_m14
[LibreOffice.git] / extensions / test / ole / MfcControl / MfcControl.cpp
blobe82c356fa77b409dc77c79d5e33986a600b2e625
1 // MfcControl.cpp : Implementation of CMfcControlApp and DLL registration.
3 #include "stdafx.h"
4 #include "MfcControl.h"
6 #ifdef _DEBUG
7 #define new DEBUG_NEW
8 #undef THIS_FILE
9 static char THIS_FILE[] = __FILE__;
10 #endif
13 CMfcControlApp NEAR theApp;
15 const GUID CDECL BASED_CODE _tlid =
16 { 0xac221fb3, 0xa0d8, 0x11d4, { 0x83, 0x3b, 0, 0x50, 0x4, 0x52, 0x6a, 0xb4 } };
17 const WORD _wVerMajor = 1;
18 const WORD _wVerMinor = 0;
21 ////////////////////////////////////////////////////////////////////////////
22 // CMfcControlApp::InitInstance - DLL initialization
24 BOOL CMfcControlApp::InitInstance()
26 BOOL bInit = COleControlModule::InitInstance();
28 if (bInit)
30 // TODO: Add your own module initialization code here.
33 return bInit;
37 ////////////////////////////////////////////////////////////////////////////
38 // CMfcControlApp::ExitInstance - DLL termination
40 int CMfcControlApp::ExitInstance()
42 // TODO: Add your own module termination code here.
44 return COleControlModule::ExitInstance();
48 /////////////////////////////////////////////////////////////////////////////
49 // DllRegisterServer - Adds entries to the system registry
51 STDAPI DllRegisterServer(void)
53 AFX_MANAGE_STATE(_afxModuleAddrThis);
55 if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
56 return ResultFromScode(SELFREG_E_TYPELIB);
58 if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
59 return ResultFromScode(SELFREG_E_CLASS);
61 return NOERROR;
65 /////////////////////////////////////////////////////////////////////////////
66 // DllUnregisterServer - Removes entries from the system registry
68 STDAPI DllUnregisterServer(void)
70 AFX_MANAGE_STATE(_afxModuleAddrThis);
72 if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
73 return ResultFromScode(SELFREG_E_TYPELIB);
75 if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
76 return ResultFromScode(SELFREG_E_CLASS);
78 return NOERROR;