DUILIB打包资源到EXE
2017-02-15 本文已影响117人
晓函
首先把资源文件都打包成ZIP压缩包
Paste_Image.png Paste_Image.png Paste_Image.png Paste_Image.png一定要是ZIPRES
Paste_Image.png
重载这两个资源函数
设置资源ID, 和 加载资源方式.
virtual LPCTSTR GetResourceID() const
{
return MAKEINTRESOURCE(资源ID);
};
virtual UILIB_RESOURCETYPE GetResourceType() const
{
return UILIB_ZIPRESOURCE;
};
winmain函数里面加一个
CPaintManagerUI::SetInstance(hInstance);
int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
CPaintManagerUI::SetInstance(hInstance);
HRESULT Hr = ::CoInitialize(NULL);
if( FAILED(Hr) ) return 0;
CLoginWnd Login;
Login.Create(NULL, _T("LoginWnd"), UI_WNDSTYLE_FRAME, WS_EX_WINDOWEDGE);
Login.CenterWindow();
Login.ShowModal();
::CoUninitialize();
return 0;
}