宁静致远

------------------------------------------------------------------------------------

VC知识库BLOG 首页 新随笔 联系 聚合 登录
  45 Posts :: 0 Stories :: 112 Comments :: 1 Trackbacks

公告

-----000来了哈000-----

留言簿(0)

随笔分类

随笔档案

文章档案

相册

技术FAQ

搜索

最新评论

阅读排行榜

评论排行榜

制作资源dll

当制作多语言版本的软件的时候,制作不同语言的资源dll,通过切换dll而实现不同的语言版本是非常有意义的。

通常,dllDllMain()函数开始。制作资源dll的时候,可以没有DllMain()函数。

 

1.选择Win32 Dynameic~Link Library
 

2.制作一个空的工程,插入资源。

3.设置工程link选项,设置dll没有入口函数,OK!



4.使用方法:

 

#include "..\resdll\resource.h"

 

void CRdlltestDlg::OnButton1()

{

       HANDLE hDll;      

       HRSRC hRes;         

 

       hExe = LoadLibrary("..\\resdll\\resdll.dll");

       if (hExe == NULL)

       {

              AfxMessageBox("Could not load dll.");

       }

      

char buff[1000] = "\0";

       int r = ::LoadString((struct HINSTANCE__ *)hDll,IDS_STR,buff,255);

       AfxMessageBox(buff);

 

       // Clean up.

       if (!FreeLibrary((struct HINSTANCE__ *)hDll))

       {

              AfxMessageBox("Could not free dll.");

       }

}

posted on 2005-04-30 15:34 blog of vc_student 阅读(2874) 评论(1)  编辑 收藏

Feedback

# re: 制作资源dll 2008-10-29 22:30 xx
谢谢. .. 呵呵, ,终于找到答案了.~~

标题  
姓名  
主页
验证码 *
内容   
  登录  使用高级评论  Top
[使用Ctrl+Enter键可以直接提交]