如何将参数传递给DLL初始化(例如通过调用LoadLibrary加载时)? [英] How to pass arguments to DLL initialization (ex. when loaded via LoadLibrary)?
本文介绍了如何将参数传递给DLL初始化(例如通过调用LoadLibrary加载时)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
一个人怎么能参数传递给调用LoadLibrary通过加载的DLL的初始化函数?是否有可能呢?不诉诸某种形式的导出函数或共享内存,那是。
How could one pass arguments to the initialization function of a DLL loaded via LoadLibrary? Is it possible at all? Without resorting to some kind of exported function or shared memory, that is.
推荐答案
有没有直接的方法。
的最简单的可能是通过环境变量。他们可以很容易调用之前设置 LoadLibray
与 SETENV
,然后DLL(在同一个进程)可以检索他们与 GETENV
。
The easiest may be through environment variables. They can be set easily before calling LoadLibray
with setenv
, and then the DLL (in the same process) can retrieve them with getenv
.
这篇关于如何将参数传递给DLL初始化(例如通过调用LoadLibrary加载时)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文