is it possible to embed a native win32 dll as resource and use pinvoke?

  • Thread starter Thread starter babylon
  • Start date Start date
B

babylon

if I have a Win32 DLL - X.DLL
can I embed it to a .Net Application and invoke it's exported functions?

normally i have to put the X.DLL in the file system and use DllImport to
import/invoke the function
I just wanna combine everything into a single .exe

thank you
 
What you can do is embed it as a manifest resource stream and then at
runtime extract it, save it to the app's directory and then call it. You'll
have to specify only the filename in your [DllImport] statement for that to
work.
 
Back
Top