| HitmaeN's profileGameDevErBlogListsNetwork | Help |
|
|
5/21/2007 调用动态加载的DLL中的重载函数看书时发现书中没有这方面的讲解,于是自己动手试验了一下,不知道这样做是否“正点”
,欢迎讨论。关于DLL最基本的知识就不提了,开门见山地讲吧! 现有动态链接库DLL_Sample.dll DLL_Sample.h: #ifdef TEST_API # define TEST_API _declspec(dllexport) #else # define TEST_API _declspec(dllimport) #endif![]() TEST_API int fuc(int a); TEST_API int fuc(int a, int b); TEST_API int fuc(int a, int b, int c);DLL_Sample.cpp: #define TEST_API
#include "DLL_Sample.h" TEST_API int fuc(int a) { return a; } TEST_API int fuc(int a, int b) { return a + b; } TEST_API int fuc(int a, int b, int c) { return a + b + c; }
LIBRARY DLL_Sample EXPORTS fuc1=?fuc@@YAHH@Z fuc2=?fuc@@YAHHH@Z fuc3=?fuc@@YAHHHH@Z 然后写动态调用的示例代码(这里调用了第二个版本的fuc函数): ![]() HINSTANCE hInst = LoadLibrary("Dll_Sample.dll"); typedef int (*MyProc)(int a, int b); MyProc Fuc = (MyProc)GetProcAddress(hInst, "fuc2"); if (!Fuc) { MessageBox ("Fuc2 is null!"); return; } CString str; str.Format ("a + b = %d", Fuc(2, 3) ); MessageBox(str); FreeLibrary (hInst); ![]() ![]() 结果输出“a + b = 5” 3/3/2007 3D MathC++ / STL
Debuggingintro articles 2/26/2007 VS 插件 VA今天在看OGRE代码的时候发现VS的智能感知不起作用了,很是影响学习代码。
上网搜了一下,按照别人说的,删除了几个文件又重新打开,结果还是不行,然后知道有个叫Visual Assist(VA)的VS插件。试了一下,问题解决了,这个插件真的很好用,比VS自己的智能感知更智能更强大,是程序员的得力助手。 虽然问题的原因没有找到,它的很多特性我还没依依弄清楚,但是不管怎样,又发现了一个得力工具,值得庆贺! 9/7/2006 文档生成器最流行的文档生成工具Doxygennon-commercial documentation tools
commercial documentation tools3/9/2006 注重实效的程序员之快速参考指南
|
|
|