dokan-dev / dokan-rust

Dokan Rust Wrapper
MIT License
44 stars 8 forks source link

How to customize dokan1.dll dependencies? #4

Open 834772509 opened 2 years ago

834772509 commented 2 years ago

I tried to embed Dokany into my application, but after importing "dokan-rust", the program will forcefully request "dokan1.dll", and the main() entry is not executed, so the dll cannot be released in the main() function, is there any How to customize the dependencies of "dokan1.dll"?

Liryna commented 2 years ago

dokan1.dll dependence cannot be customized but you could dynamically import dokan-rust when needed so that dokan1.dll is only requested when you know it is available to your app.

834772509 commented 2 years ago

How to dynamically import dokan-rust? I tried to extract the relevant code using dokan to a location other than main, but it still doesn't work, it seems that as long as the relevant code using dokan is used in the program, dokan1.dll will be requested.

Liryna commented 2 years ago

I don't have rust knowledge to provide guidance sorry but I imagine you will need to dynamically load dokan-rust library by using rust standard API and therefore not directly link with it. There must be some examples on stackoverflow to do that.