-
Import DLL manually
Hi people !! :)
Well... I'm developing an application and I need to know how I can to import a DLL with code and not with "Add reference" because path will be change when I connect to other computer.
The library I need to import is ADOX but Maybe it will be used by me with another dlls :)
Thanks for y'all!!
-
Re: Import DLL manually
If you create windows application, you can add that DLL file while creating setup and deployment. You can use anywhere. DLL will be inbuilt with you Setup file. (Only in Windows application)
-
Re: Import DLL manually
Well... I don't know it, but I don't want to make a setup because I want that my application will be portable :)
Although I will try it :)
Thanks !!!
-
Re: Import DLL manually
for portable, you can keep that DLL file in BIN folder. Use the code to read the path from computer, where you going to use.
-
Re: Import DLL manually
You're going about this all wrong. ADOX is a COM library and it's part of Windows. You absolutely do NOT need to load it dynamically. You MUST reference it at design time, no question. You don't have to care where the library is. It's a registered COM component, so it will always be accessible.
When you reference a COM component or ActiveX control, an Interop DLL will be created. It is a .NET assembly that provides the bridge between the managed code of your app and the unmanaged code of the COM component, allowing them to INTEROPerate. That DLL must be deployed with your EXE and placed in the same folder. That's it, that's all.