VC学习到的东西
2009-05-25 15:24
344 查看
1 CString 到const char* 类型转换:
......
CString str = "XXXXX";
const char* p_chr_const = (LPCTSTR)str;
......
2 dll显式加载
外部定义库中的函数
例如库中有一函数 void myfunction(const CString) 则,外部定义时为:
typedef void(_cdecl *MY1)(const CString);
其他步骤:
HINSTANCE hinstDLL = NULL;
hinstDLL=LoadLibrary("XXXXXX.dll");
if (hinstDLL != NULL)
{
MY1 myfun;
myfun = (MY2)GetProcAddress(hinstDLL, "myfunction");
.....中间省去myfun(即myfunction)函数的使用情况
FreeLibrary(hinstDLL);
}
else
{
AfxMessageBox("dll load failed!");
}
......
CString str = "XXXXX";
const char* p_chr_const = (LPCTSTR)str;
......
2 dll显式加载
外部定义库中的函数
例如库中有一函数 void myfunction(const CString) 则,外部定义时为:
typedef void(_cdecl *MY1)(const CString);
其他步骤:
HINSTANCE hinstDLL = NULL;
hinstDLL=LoadLibrary("XXXXXX.dll");
if (hinstDLL != NULL)
{
MY1 myfun;
myfun = (MY2)GetProcAddress(hinstDLL, "myfunction");
.....中间省去myfun(即myfunction)函数的使用情况
FreeLibrary(hinstDLL);
}
else
{
AfxMessageBox("dll load failed!");
}
相关文章推荐
- VC实例学习 (1):总结下今天学习的东西
- 要开始系统的规划学习的东西了
- 笔记:学习vc之makefile
- VC++学习(12):文件操作
- cuda学习(linux公社下载地址: http://linux.linuxidc.com/东西比较多)
- VC学习资料收集(10):udp服务器设计过程总结
- VC学习笔记:状态栏
- VC学习资料收集(13):单独使用CRecordSet
- 学习VC++深入浅出——状态栏的设置
- 学习VC++深入浅出——常用对话框的操作
- VC学习资料收集(19):使用通用对话框
- C语言,C++,C#,VC++语言学习,及应用网址
- 在学习递归后序时学到的东西.
- VC++/MFC(VC6)精品学习资料下载+Visual Studio 6.0/2008/2010下载
- 学习VC一年多的心得
- Win7下vc 6.0在学习时问题解决(包括AppWizard错误、控件无法注册、控件无法导出类)
- VC学习
- MSDN下自带学习VC例程路径
- VC2008 beta2 的几个新东西
- VC学习1