使用soui开发的mbc,只支持windows版本
w1146869587
2022-01-24 4905e2e7537d507f218e8e9595485e09d9f3a2b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// mbInside.cpp : Defines the initialization routines for the DLL.
//
 
#include "stdafx.h"
#include "mbInside.h"
#include <initguid.h>
#include "mbInside_i.c"
 
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
 
//
//TODO: If this DLL is dynamically linked against the MFC DLLs,
//        any functions exported from this DLL which call into
//        MFC must have the AFX_MANAGE_STATE macro added at the
//        very beginning of the function.
//
//        For example:
//
//        extern "C" BOOL PASCAL EXPORT ExportedFunction()
//        {
//            AFX_MANAGE_STATE(AfxGetStaticModuleState());
//            // normal function body here
//        }
//
//        It is very important that this macro appear in each
//        function, prior to any calls into MFC.  This means that
//        it must appear as the first statement within the 
//        function, even before any object variable declarations
//        as their constructors may generate calls into the MFC
//        DLL.
//
//        Please see MFC Technical Notes 33 and 58 for additional
//        details.
//
 
// CmbInsideApp
 
 
class CmbInsideModule :
    public ATL::CAtlMfcModule
{
public:
    DECLARE_LIBID(LIBID_mbInsideLib);
    DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MBINSIDE, "{826BB81F-4F07-42C5-80BA-06E84B81363D}");};
 
CmbInsideModule _AtlModule;
 
BEGIN_MESSAGE_MAP(CmbInsideApp, CWinApp)
END_MESSAGE_MAP()
 
 
// CmbInsideApp construction
 
CmbInsideApp::CmbInsideApp()
{
    // TODO: add construction code here,
    // Place all significant initialization in InitInstance
}
 
 
// The one and only CmbInsideApp object
 
CmbInsideApp theApp;
 
 
// CmbInsideApp initialization
 
BOOL CmbInsideApp::InitInstance()
{
    COleObjectFactory::RegisterAll();
    CWinApp::InitInstance();
 
    return TRUE;
}
 
// DllCanUnloadNow - Allows COM to unload DLL
#if !defined(_WIN32_WCE) && !defined(_AMD64_) && !defined(_IA64_)
#pragma comment(linker, "/EXPORT:DllCanUnloadNow=_DllCanUnloadNow@0,PRIVATE")
#pragma comment(linker, "/EXPORT:DllGetClassObject=_DllGetClassObject@12,PRIVATE")
#pragma comment(linker, "/EXPORT:DllRegisterServer=_DllRegisterServer@0,PRIVATE")
#pragma comment(linker, "/EXPORT:DllUnregisterServer=_DllUnregisterServer@0,PRIVATE")
#else
#if defined(_X86_) || defined(_SHX_)
#pragma comment(linker, "/EXPORT:DllCanUnloadNow=_DllCanUnloadNow,PRIVATE")
#pragma comment(linker, "/EXPORT:DllGetClassObject=_DllGetClassObject,PRIVATE")
#pragma comment(linker, "/EXPORT:DllRegisterServer=_DllRegisterServer,PRIVATE")
#pragma comment(linker, "/EXPORT:DllUnregisterServer=_DllUnregisterServer,PRIVATE")
#else
#pragma comment(linker, "/EXPORT:DllCanUnloadNow,PRIVATE")
#pragma comment(linker, "/EXPORT:DllGetClassObject,PRIVATE")
#pragma comment(linker, "/EXPORT:DllRegisterServer,PRIVATE")
#pragma comment(linker, "/EXPORT:DllUnregisterServer,PRIVATE")
#endif // (_X86_)||(_SHX_)
#endif // !_WIN32_WCE && !_AMD64_ && !_IA64_ 
 
STDAPI DllCanUnloadNow(void)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (_AtlModule.GetLockCount() > 0)
        return S_FALSE;
    return S_OK;
}
 
// DllGetClassObject - Returns class factory
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    if (S_OK == _AtlModule.GetClassObject(rclsid, riid, ppv))
        return S_OK;
    return AfxDllGetClassObject(rclsid, riid, ppv);
}
 
// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    _AtlModule.UpdateRegistryAppId(TRUE);
    HRESULT hRes2 = _AtlModule.RegisterServer(TRUE);
    if (hRes2 != S_OK)
        return hRes2;
    if (!COleObjectFactory::UpdateRegistryAll(TRUE))
        return ResultFromScode(SELFREG_E_CLASS);
    return S_OK;
}
 
// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void)
{
    AFX_MANAGE_STATE(AfxGetStaticModuleState());
    _AtlModule.UpdateRegistryAppId(FALSE);
    HRESULT hRes2 = _AtlModule.UnregisterServer(TRUE);
    if (hRes2 != S_OK)
        return hRes2;
    if (!COleObjectFactory::UpdateRegistryAll(FALSE))
        return ResultFromScode(SELFREG_E_CLASS);
    return S_OK;
}