简体   繁体   English

如何确定一个 dll 是否已经注册到我的 c++ function?

[英]how to determine whether a dll has been registered with my c++ function?

A newbie question-一个新手问题——

I want to write a wrapper function in windows c++ which will look into some input parameters passed and based on whether an associated dll is registered or not would respond to the application. I want to write a wrapper function in windows c++ which will look into some input parameters passed and based on whether an associated dll is registered or not would respond to the application.

So basically i need to所以基本上我需要

1)register dlls with my wrapper fn 2)the wrapper should scan through the registered dlls 1)用我的包装器 fn 注册 dll 2)包装器应该扫描注册的 dll

what is the best way to do this??做这个的最好方式是什么?? where to start?从哪儿开始?

I'm not sure what you mean by register - are we talking about COM registration or your own custom registration system?我不确定您所说的注册是什么意思-我们是在谈论 COM 注册还是您自己的自定义注册系统?

In any case, once you know what DLLs to load, use LoadLibrary to load the DLL into memory, and GetProcAddress to get pointers to exported functions from the DLL.在任何情况下,一旦您知道要加载哪些 DLL,请使用LoadLibrary将 DLL 加载到 memory 中,并使用GetProcAddress从 Z5884E40D596370BE5406F2711ADE980E291Z 中获取指向导出函数的指针。 If you're doing a plugin-style thing, you'll probably want to call an initialization function in the DLL, and allow the DLL to do any setup it may need to register itself with your application.如果你正在做一个插件式的事情,你可能想要在 DLL 中调用一个初始化 function,并允许 DLL 进行任何可能需要的设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM