📄 01_9_17_21.asp.html
字号:
<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<TITLE>计算机世界网-得到关于DLL/EXE模块的完整信息</TITLE></HEAD>
<style>
.a14{font-size:14px;text-indent:25px;line-height:20px}
.f{font-size:18px;color=#0f3ccd}
img{border:0px;}
td,p,input{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<center>
<BODY topmargin=2 leftmargin=0>
<style>
.v12{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<style>
.v13{font-size:10pt;color:"#ffffff";FONT-WEIGHT: bold}
.v12{font-size:13px;color:"#4C029C";FONT-WEIGHT: bold}
.v14{font-size:14px;text-indent:25px;line-height:20px}
img{border:0px;}
td,p,input,select{font-fammily:verdana,宋体;font-size:12px;}
A:link {text-decoration:none;color:black}
A:visited {text-decoration:none;color:#80006f}
A:hover {text-decoration:underline;color:black}
</style>
<!--头-->
<table align=center cellpadding="0" cellspacing="0" border="0" width="767">
<tr><td valign=bottom>
<table cellpadding="0" cellspacing="0" border=0>
<tr><td valign=top><img src="../../../../../center/image/ccwlogo.gif"></td></tr>
<tr><td height="27" valign=top><img src="../../../../../center/image/knowledge.gif" width="207" height="27"></td></tr>
</table></td>
<td valign=bottom width=556 bgcolor="#4c029c" height=96>
<table cellpadding="0" cellspacing="0" border=0 width=556 bgcolor="#4c029c" height=96>
<tr><td height=25 valign=bottom bgcolor="#ffffff" colspan=2 ><img src="../../../../../image2002/top.gif" usemap="#F"></td></tr>
<tr valign=middle >
<td align=center valign=middle height="60" align=center>
<!-- <a href="http://www.ccw.com.cn/search/" target=_blank><img src="../../../../../img2/esearch.GIF" border=0 width=468 height=60></a> --><a href="http://www.ccw.com.cn/html/search/thememail/" target=_blank><img src="../../../../../img2/topbanner_thememail.GIF" border=0 width=468 height=60></a>
</td>
<td align=center width=15%>
<table width=95%>
<tr><td><a href="mailto:center@ccw.com.cn?subject=我要投稿:" target=_blank><font class=v13>我要投稿</a><br><a href="mailto:center@ccw.com.cn?subject=编读往来"><font class=v13>编读往来</a><br><a href="javascript:AddBookMark('计算机世界网首页')"><font class=v13>加入收藏</a></font></td></tr>
</table>
</td>
</tr>
<tr><td bgcolor="#ffffff" height=1 colspan=2 ></td></tr>
<tr><td bgcolor="#b4aafc" height=2 colspan=2 ></td></tr></table>
<map name="F">
<area href="http://www.ccw.com.cn/" shape="rect" coords="29, 3, 61, 18" target=_blank>
<area href="http://www.ccw.com.cn/news1/" shape="rect" coords="72, 3, 143, 18" target=_blank>
<area href="http://www.ccw.com.cn/center/" shape="rect" coords="155, 2, 216, 18" target=_blank>
<area href="http://www.ccw.com.cn/work/" shape="rect" coords="225, 2, 299, 18" target=_blank>
<area href="http://www.ccw.com.cn/search/" shape="rect" coords="310, 3, 364, 19" target=_blank>
<area href="http://www3.ccw.com.cn/" shape="rect" coords="372, 2, 412, 19" target=_blank>
<area href="http://www2.ccw.com.cn/" shape="rect" coords="424, 2, 550, 18" target=_blank></map>
</td></tr>
<tr><td colspan=2 bgcolor="#b4aafc">
<table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr>
<td width=26% align=center><font class=v12>【2003年6月24日】 </font></td>
<td CLASS=V12> <a href="http://www.ccw.com.cn/center/topic.asp">专 题</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/tech.asp">技 术</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/prod.asp">产 品</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/app.asp">应 用</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/net.asp">网 络</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/prog.asp">编 程</a> /</td>
<td CLASS=V12><a href="http://www.ccw.com.cn/center/skill.asp">技 巧</a> </td>
</tr>
</table>
</td></tr>
</table>
<table align=center width=728>
<tr><td align=center><br><h2><font color='#0f3ccd'>得到关于DLL/EXE模块的完整信息</font></h2>
</td></tr><tr><td align=right>01-9-17 下午 01:26:07<br><hr size=1 width=718 color=#f46240></td></tr></table><br>
<table align=center width=728><tr><td valign=top width=600>
<table width=100% ><tr><td class=a14>我看过一些讨论如何从资源文件得到版本信息和如何得到在你机器上安装的公用控制的动态链接库的版本信息的文章,这篇文章讲述了同样的问题,但是它有一些修改。</td></tr></table><table width=100% ><tr><td class=a14>
想其他文章一样,我也用到了同样的API函数::GetFileVersionInfo.但是,如果当DLL/EXE模块没有映射到当前进程的内存空间是,该函数不工作。要是该函数工作,将模块调入进程的内存空间是非常重要的。</td></tr></table><table width=100% ><tr><td class=a14>
我已经过实验建立了一个封装类,来得到关于DLL/EXE模块的完整信息。该类的名字为CLibraryInfo。</td></tr></table><table width=100% ><tr><td class=a14>
下面的代码片段为了查找信息得到DLL/EXE模块的句柄。如果第一个调用失败,我假定模块不在进程的内存映象中,我明确地在进程加载该模块。如果仍然失败,则返回错误报告。</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
hmodule = ::getmodulehandle (m_dllinfo.stdllname);</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
if (hmodule == null) {</td></tr></table><table width=100% ><tr><td class=a14>
// the dll/module may not be mapped into our space. so try to load the module</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
hmodule = (hmodule)loadlibrary (m_dllinfo.stdllname);</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
if (hmodule == null) {</td></tr></table><table width=100% ><tr><td class=a14>
return (false);</td></tr></table><table width=100% ><tr><td class=a14>
}</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
m_blibloaded = true;</td></tr></table><table width=100% ><tr><td class=a14>
}</td></tr></table><table width=100% ><tr><td class=a14>
该项目已经在Windows95用VC++6编译完成。如果你试图用以前版本的VC打开该项目将会得到一些通过VC6编译器设置的和调试标志相关的警告错误。这对项目编译是非常重要的。version.lib已经包含在Link/Compile Setting中。</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr></table><table width=100% ><tr><td class=a14>
</td></tr>
</table><br>
<style>.a1{font-size:1}</style>
<table width=100% ><tr><td align=right>(网页编辑:<a href='mailto:liu_yang@ccw.com.cn'>风之翼</a>)</td></tr></table>
</td><td class=a1 bgcolor=#f46240> </td>
<td valign=top width=138 align=right><table width=98% ><tr><td>
<form action='/app/gsearch1.asp' name=pdn><table width=100% ><tr><td>应用与方案
频道全文检索</td></tr>
<tr><td><input type="text" name="textfile" size=15 value=频道内检索 onfocus="this.value=''">
<input border=0 src="../../../../../images/jian.gif" name="I1" type="image" align=absmiddle>
</td></tr>
</table>
</form>
<form name=srch action="/search/which.asp" method=post onsubmit="JavaScript:return chk()">
<table width=100% >
<tr><td><select size="1" name="func">
<option selected value="2">主题检索</option>
<option value="1">周报全文检索</option>
<option value="3">模糊词检索</option>
</select></td></tr>
<tr><td><input type="text" name="SrchStr" size=15 value="输入待检索的词"
onfocus="this.value=''">
<input src="../../../../../images/jian.gif" name="I1" type="image" align="absMiddle" border=0>
</td></tr>
</table>
<script language="JavaScript">
function chk()
{if (!document.srch.SrchStr.value){
alert("请输入需检索的词!");
document.srch.SrchStr.focus();
return false;
}
else{if (document.srch.SrchStr.value.length>30){
alert("检索的词请不要超过30个字符!");
document.srch.SrchStr.focus();
return false;
}
}
}
</script></form>
<table width=100% ><tr><td class=f colspan=2><b>相关文章</b></td></tr>
<tr><td valign=top><IMG SRC=../../../../../img2/jiao.gif></td><td><a href='01_9_17_20.asp.html'>检测DLL的版本号</a></td></tr>
<tr><td valign=top><IMG SRC=../../../../../img2/jiao.gif></td><td><a href='01_9_17_19.asp.html'>显示已加载的动态链接库</a></td></tr>
<tr><td valign=top><IMG SRC=../../../../../img2/jiao.gif></td><td><a href='01_9_17_18.asp.html'>在MFC扩展DLL中输出对话框</a></td></tr>
<tr><td valign=top><IMG SRC=../../../../../img2/jiao.gif></td><td><a href='01_9_17_17.asp.html'>在动态链接库里使用对话框</a></td></tr>
<tr><td valign=top><IMG SRC=../../../../../img2/jiao.gif></td><td><a href='../neimu/01_9_17_36.asp.html'>4.3 内存漏洞的检查</a></td></tr>
</table>
</td></tr></table></td></tr></table><br>
<table align=center width=680><tr><td align=right>
<form name=mail method=post action='/pub/subMail.asp' onsubmit='JavaScript: return chkField(this)'>
<INPUT type='hidden' name='rec' value='24364'>
您的姓名:<INPUT type="text" name=myName size=10>
您朋友的E-mail:<INPUT type="text" name=friendMail size=10>
<INPUT type="submit" value="推荐给好友">
</form>
</td></tr>
<tr><td align=right>
<b>[<a href="javascript:window.close()">关闭窗口</a>]</b>
</td></tr>
</table>
<script language="javascript">
function chkField(fmObj)
{if (!fmObj.friendMail.value){
alert("请输入您朋友的E-mail!");
fmObj.friendMail.focus();
return false;
}
return true;
}
</script>
<table align=center width=680>
<tr><td><hr size=1 width=660 color=#f46240></td></tr>
</table><br>
<p align=center>Copyright(C) ccw.com.cn,All rights reserved</p>
<p align=center><b>中国计算机世界出版服务公司版权所有</b></p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -