資源簡介
使用VS2012窗口示例代碼,具有網頁調用的外部接口,同時實現推送給網頁的消息。具體說明請參考:
https://blog.csdn.net/ptrunner/article/details/88971813
代碼片段和文件信息
//?MFCActiveXControl1.cpp?:?CMFCActiveXControl1App?和?DLL?注冊的實現。
#include?“stdafx.h“
#include?“MFCActiveXControl1.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#endif
CMFCActiveXControl1App?theApp;
const?GUID?CDECL?_tlid?=?{?0xE976D19A?0xD0DA?0x4DFE?{?0xAC?0x83?0xC1?0x55?0xAB?0xE?0xE7?0xC9?}?};
const?WORD?_wVerMajor?=?1;
const?WORD?_wVerMinor?=?0;
//?CMFCActiveXControl1App::InitInstance?-?DLL?初始化
BOOL?CMFCActiveXControl1App::InitInstance()
{
BOOL?bInit?=?COleControlModule::InitInstance();
if?(bInit)
{
//?TODO:?在此添加您自己的模塊初始化代碼。
}
return?bInit;
}
//?CMFCActiveXControl1App::ExitInstance?-?DLL?終止
int?CMFCActiveXControl1App::ExitInstance()
{
//?TODO:?在此添加您自己的模塊終止代碼。
return?COleControlModule::ExitInstance();
}
//?DllRegisterServer?-?將項添加到系統注冊表
STDAPI?DllRegisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
if?(!AfxOleRegisterTypeLib(AfxGetInstanceHandle()?_tlid))
return?ResultFromScode(SELFREG_E_TYPELIB);
if?(!COleobjectFactoryEx::UpdateRegistryAll(TRUE))
return?ResultFromScode(SELFREG_E_CLASS);
return?NOERROR;
}
//?DllUnregisterServer?-?將項從系統注冊表中移除
STDAPI?DllUnregisterServer(void)
{
AFX_MANAGE_STATE(_afxModuleAddrThis);
if?(!AfxOleUnregisterTypeLib(_tlid?_wVerMajor?_wVerMinor))
return?ResultFromScode(SELFREG_E_TYPELIB);
if?(!COleobjectFactoryEx::UpdateRegistryAll(FALSE))
return?ResultFromScode(SELFREG_E_CLASS);
return?NOERROR;
}
- 上一篇:車票管理系統含swing源碼
- 下一篇:raswin——用于蛋白三維結構的顯示
評論
共有 條評論