📄 subject_50453.htm
字号:
<p>
序号:50453 发表者:夏天和小凡 发表日期:2003-08-21 10:44:20
<br>主题:怎么在DLL中取得实例句柄
<br>内容:本来可以用这样。<BR>class CTaskKeyHookDll : public CWinApp {<BR>public:<BR> CTaskKeyHookDll() { }<BR> ~CTaskKeyHookDll() { }<BR>} MyDll;<BR><BR>HINSTANCE instance = MyDll.m_hInstance;<BR><BR>但我不想用MFC,求另类的方法!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:michael 回复日期:2003-08-21 10:50:01
<br>内容:用LoadLibrary()<BR>但是要知道DLL存放的路径,还有函数的原型。<BR><BR><BR><BR>LoadLibrary<BR>The LoadLibrary function maps the specified executable module into the address space of the calling process. <BR><BR>HINSTANCE LoadLibrary(<BR> LPCTSTR lpLibFileName // address of filename of executable module<BR>);<BR> <BR>Parameters<BR>lpLibFileName <BR>Pointer to a null-terminated string that names the executable module (either a .DLL or .EXE file). The name specified is the filename of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition (.DEF) file. <BR>If the string specifies a path but the file does not exist in the specified directory, the function fails. When specifying a path, be sure to use backslashes (\), not forward slashes (/). <BR><BR>If the string does not specify a path, the function uses a standard search strategy to find the file. See the Remarks for more information. <BR><BR>Return Values<BR>If the function succeeds, the return value is a handle to the module.<BR><BR>If the function fails, the return value is NULL. To get extended error information, call GetLastError. <BR><BR>摘自MSDN<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>
回复者:夏天和小凡 回复日期:2003-08-21 10:52:58
<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 + -