|
[求助]如何在程序中加载两份同样的DLL文件呀?
我直接把工程和dll文件打包发上来吧,麻烦各位win7 x86的朋友帮忙测试一下。 WIN7 X32平台 VC++ 6.0 abc.dll 和def.dll是拷自win7 x86 system32目录下的user32.dll文件改名的。 我单步看过了,打印的地址和模块地址都是有效的。 怕大家懒得看 我直接在把整个测试代码发一遍在下面。 #include <windows.h> #include <stdio.h> #include <conio.h> typedef int (CALLBACK *PMessageBoxA)(HWND hWnd,LPCSTR lpText,LPCSTR lpCaption,UINT uType); typedef int (*PADD)(int x,int y); void main() { HMODULE hLib1,hLib2; PMessageBoxA func1,func2; hLib1 = LoadLibraryA("def.dll"); printf("Last Error= %d!\n",GetLastError()); func1 = (PMessageBoxA)GetProcAddress(hLib1,"MessageBoxA"); printf("Last Error= %d!\n",GetLastError()); if (func1!=NULL) { func1(NULL,"Hello","Lib1",MB_OK); printf("Last Error= %d!\n",GetLastError()); } hLib2 = LoadLibraryA("abc.dll"); printf("Last Error= %d!\n",GetLastError()); func2 = (PMessageBoxA)GetProcAddress(hLib2,"MessageBoxA"); if (func2!=NULL) { func2(NULL,"Word","Lib2",MB_OK); printf("Last Error= %d!\n",GetLastError()); } printf("hLib1 = 0x%08X,func1 = 0x%08X\nhLib2 = 0x%08X,func2 = 0x%08X\n",hLib1,func1,hLib2,func2); _getch(); FreeLibrary(hLib1); FreeLibrary(hLib2); hLib1 = LoadLibrary("DllDemo1.dll"); hLib2 = LoadLibrary("DllDemo2.dll"); PADD func3,func4; func3 = (PADD)GetProcAddress(hLib1,"add"); func4 = (PADD)GetProcAddress(hLib2,"add"); func3(10,30); func4(10,100); printf("hLib1 = 0x%08X,func3 = 0x%08X\nhLib2 = 0x%08X,func4 = 0x%08X\n",hLib1,func3,hLib2,func4); FreeLibrary(hLib1); FreeLibrary(hLib2); } 下面是附件工程: testLoadDll.zip |
|
[求助]如何在程序中加载两份同样的DLL文件呀?
我的是32位的系统 ,可以加载,但是显示的不对,不知道为啥,按理应该可以呀。X64不能加载,不管怎么说,这里肯定有些问题吧。 |
|
[求助]如何在程序中加载两份同样的DLL文件呀?
我单步调试的时候,看过 函数返回成功了。没有崩溃。 |
|
[求助]如何在程序中加载两份同样的DLL文件呀?
把user32.dll拷的我的程序目录下,改名为abc.dll,重新拷贝一份改名为def.dll,然后定义typedef int(WINAPI* PMessageBoxA)(HWND,LPCSTR,LPCSTR,int); HMODULE hLib1,hLib2; hLib1 = LoadLibrary(".\\abc.dll"); hLib2 = LoadLibrary(".\\def.dll"); PMessageBoxA func1 = (PMessageBoxA)GetProcAddress(hLib1,"MessageBoxA"); PMessageBoxA func2 = (PMessageBoxA)GetProcAddress(hLib2,"MessageBoxA"); func1(NULL,"Hello","sdf",MB_OK); func2(NULL,"Word","abd",MB_OK); getch(); FreeLibrary(hLib1); FreeLibrary(hLib2); 在VC++6.0环境中测试,系统是WIN7 32旗舰版+AMD CPU 然后现象是只显示了一个MessageBox,而且内容显示为空,标题有。第二个MessageBox没有显示。用PC Hunter看了一下,进程模块中只有abc.dll。没有报错,没有蓝屏。大概就是这个情况。 |
|
[求助]如何在程序中加载两份同样的DLL文件呀?
我改了呀,我想加载系统的文件,比如ws2_32.dll或者User32.dll,加载自己的文件改名字是没有问题的。但是加载系统的文件就不行,不知道为什么呀 |
|
[讨论]如何让扫描的PDF文件更清晰?
windows内核情景分析 |
|
[讨论]如何让扫描的PDF文件更清晰?
问题我是不是没有说清楚呀,我的问题就是不知道如何找到处理按键和鼠标的消息循环, 我必须找到这个才能够继续。 |
|
[讨论]如何让扫描的PDF文件更清晰?
我只是想写一个小工具而已,能够改善阅读效果。。。。。。 |
|
|
|
[求助]自己写一个软件安装程序
可以去看IPMsg的源代码,里面有写安装程序的源代码,SDK的。 |
|
[求助]请问下面这个dll是什么壳呀?
谢谢啦,以前一直没有上,事情多,现在有空了,可以搞搞自己感兴趣的事情了.这个软件我去下了,不过你在论坛给的那个地址好像下不了,我在http://www.xiazaiba.com/html/1550.html下载的,查的跟你一样. |
|
[公告]从本月开始,将评比每月的优秀精华文章
支持,同时希望论坛开些研究性专题~~ |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值