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

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
 
K

Klaus H. Probst

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top