📄 subject_26609.htm
字号:
<p>
序号:26609 发表者:王永军 发表日期:2003-01-03 08:54:59
<br>主题:有没有简单的显示调用DLL的例子?
<br>内容:另外我在MSDN里查FARPROC怎么都找不着啊
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:王永军 回复日期:2003-01-03 08:58:16
<br>内容:function Double (N: Integer): Integer; stdcall; external 'FIRSTDLL.DLL';<BR>比如Delphi里可以这么写声明 此后就可以象调用Delphi自己的函数一样<BR>调用 Double 这个函数 VC里如果想这么干 该怎么写 谢谢大侠
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:(zl剑客) 回复日期:2003-01-03 09:10:06
<br>内容:VC中首先编译好DLL,当然记得在模块定义文件.DEF中<BR>将你的函数导出来.<BR>在其他程序中显示的调用,通过<BR>LoadLibrary and GetProcAddress<BR>来达到目的!
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:bird 回复日期:2003-01-03 09:13:31
<br>内容:动态调用:<BR><BR>http://www.vchelp.net/vchelp/file2002_4/PosActiveX.asp?type_id=30&class_id=1&cata_id=3&article_id=884<BR><BR><BR>调用:<BR>http://www.vcfan.com/vc/article/article_dll/20011116105412.htm
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:bird 回复日期:2003-01-03 09:16:00
<br>内容:网上收索一下,很多的!<BR><BR>http://cnprogram.myrice.com/article/vc/vc415.html
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:bird 回复日期:2003-01-03 09:16:38
<br>内容:http://tech.tom.com/Archive/2001/10/31-38842.html
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:龙猫-ft 也被人用了 回复日期:2003-01-03 09:51:02
<br>内容:再问一句 刚看到这样的一段话<BR><BR>首先在欲调用DLL函数的cpp文件前部先声明函数指针,定义函数类型:<BR>typedef int (* _YANZHENG)(CString,char* zcm); <BR>然后定义如下变量∶<BR> HINSTANCE hLibrary;<BR> _YANZHENG yanzheng; <BR>在调用DLL处加入如下语句进行DLL装载: <BR> hLibrary=LoadLibrary("zcdll.dll");<BR> yanzheng=(_YANZHENG)GetProcAddress(hLibrary,"yanzheng");<BR> shuchu= (*yanzheng)(shuru,zcm);<BR> FreeLibrary(hLibrary); <BR><BR>我想在initdlg里LoadLibrary 然后在程序退出时FreeLibrary 程序执行时就不用每一次调用都Load and Free了 这样对不对?<BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:bird 回复日期:2003-01-03 10:21:01
<br>内容:我没做过,不过我想没错吧!你试试,把结果贴出来!.........
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:龙猫-ft 也被人用了 回复日期:2003-01-03 10:58:53
<br>内容: _YANZHENG yanzheng; <BR> yanzheng=(_YANZHENG)GetProcAddress(hLibrary,"yanzheng");<BR> shuchu= (*yanzheng)(shuru,zcm);<BR>这几句怎么看不明白 _YANZHENG 是什么意思?<BR> <BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:龙猫-ft 也被人用了 回复日期:2003-01-03 10:59:00
<br>内容: _YANZHENG yanzheng; <BR> yanzheng=(_YANZHENG)GetProcAddress(hLibrary,"yanzheng");<BR> shuchu= (*yanzheng)(shuru,zcm);<BR>这几句怎么看不明白 yanzheng是DLL输出的函数名 _YANZHENG 是什么意思?<BR> <BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -