你只要在你的要使用DLL的程序中将这个DLL加入你程序的资源链中就行了。或者干脆将资源链指定为这个DLL。
HINSTANCE old = AfxGetResourceHandle();
AfxSetResourceHandle(hInst);
// load resource here
.......
AfxSetResourceHandle(old) ;
HINSTANCE old = AfxGetResourceHandle();
AfxSetResourceHandle(hInst);
// load resource here
.......
AfxSetResourceHandle(old) ;
解决方案 »
- 关于托盘中气球提示的实现中遇到的问题,显示不出来气球。。。。
- 我是新手,很简单的问题,如何得到文件名和路径
- List控件SortItems()函数排序问题!
- 请教多线程中如何终止另外的线程
- 时不时的又想起了这个板块,纯散分
- WMI编程,多个同类设备的时候怎么选取其中的一个进行操作?(急)
- 请问,如何编程使A机的c端口与B机的d端口通讯?(非MFC,纯API)
- 如何从NetBios名得到ip,(给出根据IP或计算机名得到MAC的源代码)
- 一个简单的关于ado的问题
- TO SOFTDOCTOR:ABOUT CREATETOOLBAREX()AGAIN
- 如何做一个没有菜单的MDI?
- HANDLE and HWND
DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
// Remove this if you use lpReserved
UNREFERENCED_PARAMETER(lpReserved); if (dwReason == DLL_PROCESS_ATTACH)
{
// Extension DLL one-time initialization
if (!AfxInitExtensionModule(PublicDLL, hInstance))
return 0;
afxCurrentInstanceHandle = hInstance;
afxCurrentResourceHandle = hInstance; // Insert this DLL into the resource chain
// NOTE: If this Extension DLL is being implicitly linked to by
// an MFC Regular DLL (such as an ActiveX Control)
// instead of an MFC application, then you will want to
// remove this line from DllMain and put it in a separate
// function exported from this Extension DLL. The Regular DLL
// that uses this Extension DLL should then explicitly call that
// function to initialize this Extension DLL. Otherwise,
// the CDynLinkLibrary object will not be attached to the
// Regular DLL's resource chain, and serious problems will
// result. new CDynLinkLibrary(PublicDLL);
}
else if (dwReason == DLL_PROCESS_DETACH)
{
// Terminate the library before destructors are called
AfxTermExtensionModule(PublicDLL);
}
return 1; // ok
}
AfxSetResourceHandle( GetModuleHandle("XXX.dll"));
CBitmap map;
map.LoadBitmap(IDB_BITMAPTREE);//XXX.dll中得位图资源
...............
map.Detach ();
AfxSetResourceHandle( hInst );
演示文档下载地址
http://www.csdn.net/filebbs/read_topic.asp?id=385
>AVI资源如果放在了DLL中,如何在对话框中使用
可以将AVI提取出来保存在临时文件中,或直接将资源DLL设置为当前资源DLL