我写了一个程序,在主程序中调用了动态链接库,传递了一些参数到动态链接库中,现在我又准备在动态链接库中调用主程序中的某个函数,但就是不知道怎么样实现,哪位大侠知道,谢谢
解决方案 »
- win7如何获得扩展TCP连接表和扩展UDP监听表
- 求tcp通信中服务器端while(1){accept()}占用cpu100%的解决办法?
- vc2005中,如何实现cedit多行显示不闪烁,如果用双缓冲,怎么用?
- 关键字:OpenGL, 颜色, MFC
- 高手指教,如何用vc写一程序,使之不能在进程中看到呢?
- [Help]请教:如何使用MFC编写一个可以被ASP脚本所使用的DLL形式的COM组件?
- Panr(光荣) 近来拿分 500份求COM问题
- 诸位有没有用过OWC中的chart,小弟没有使用成功,能否提供点原代码,分数不多,让您见笑!
- 怎样在程序中设置默认纸张方向
- error LNK2001: unresolved external symbol "public: __thiscall CServerDlg::CServe
- 如何设置任务栏的图标和标题
- 我只想知道使用VC是否可以做多层结构数据?如果能的化,可否大概说一下,连接的过程!来着有分!up也行!
如果是希望静态装入,你可为EXE产生导出库,然后在dll的Project中将其连入..
不过并不建议这么做.会降低程序的模块化程度.违背了设计动态连接库的初衷..
The GetModuleHandle function retrieves a module handle for the specified module if the file has been mapped into the address space of the calling process. To avoid the race conditions described in the Res section, use the GetModuleHandleEx function.HMODULE GetModuleHandle(
LPCTSTR lpModuleName // module name
);
Parameters
lpModuleName
[in] Pointer to a null-terminated string that contains the name of the module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the names of modules currently mapped into the address space of the calling process.
If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process. Return Values
If the function succeeds, the return value is a handle to the specified module.If the function fails, the return value is NULL. To get extended error information, call GetLastError.