Author Topic: Embed unmanaged dll files into the app's executable file - VB & C#  (Read 3878 times)

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
All of the related code can be found here:

   https://www.advancedhmi.com/forum/index.php?topic=2563.msg16238#new

It has somewhat unorthodox approach, which is to embed the unmanaged dll file as a resource and create a standalone exe file as the output.

Once run, the app will create a copy of the embedded dll file in the application folder, load it in memory when first needed and delete the file when the app is closed. All this is handled within the ApplicationEvents.vb / Program.cs file.

One could possibly use Windows\Temp or some other folder to copy the unmanaged dll files to, but would need to make sure that all the DLLImports, for the functions inside the unmanaged dll files, contain the full string path.



« Last Edit: June 16, 2020, 05:32:40 AM by Godra »