原创  VC程序资源的替换 收藏

  1. void SResource()
  2. {  
  3.         HINSTANCE Res;
  4.     HINSTANCE ResourceDll;
  5.     //加载资源文件
  6.     ResourceDll  = AfxLoadLibrary(_T("MyResource.dll"));
  7.     if (NULL == ResourceDll) 
  8.     {
  9.         return;
  10.     }
  11.     
  12.     //切换资源 
  13.     Res = AfxGetResourceHandle();
  14.     AfxSetResourceHandle(theApp.m_hInstance);
  15.     AfxSetResourceHandle(ResourceDll);
  16.     
  17. }
  18. void Delete Resource()
  19. {
  20.     AfxSetResourceHandle(AfxGetInstanceHandle());
  21. }

发表于 @ 2008年11月17日 18:18:00 | 评论( loading... ) | 编辑| 举报| 收藏

旧一篇:使用Command模式实现撤销机制[1] | 新一篇:资源动态替换的详细步骤

  • 发表评论
  • 评论内容:
  •  
Copyright © feisy
Powered by CSDN Blog