DLL dependency question / SetDLLDirectory

前端 未结 4 1459
小鲜肉
小鲜肉 2020-12-20 03:06

I have the following situation and can\'t come up with any good solution.

I have a C++ application (app.exe) installed in C:\\ProgFiles\\MyApp. It needs a bunch of

4条回答
  •  北海茫月
    2020-12-20 03:43

    See this article from Microsoft which discusses the DLL search path and related issues.

    In particular, notice that if you do not put them in your app’s directory the current directory takes precedence, which is a security hole.

    One solution would be to use LoadLibrary (with a fully-qualified path), then GetProcAddress. That would be kind of painful.

    No normal user is going to go digging around in C:\Program Files\YourApp and that is where you should put them unless you have a good reason not to.

提交回复
热议问题