I use PInvoke on a win32 DLL and i've currently placed it in my System32 folder. Is there an alternative to this? What if my app needs to be deployed somewhere where i dont have access to system folders?
+3
A:
So long as the DLL is present somewhere on the Path that is used by the app, it should get loaded properly. The approach you have described here works because of this trait: System32 is always in the path.
Here is some more info on how DLLs are located for loading. Your app can know its own path via
System.Environment.GetEnvironmentVariable("Path");
Steve Townsend
2010-09-30 14:14:25
What do you mean path used by the app?
smkngspcmn
2010-09-30 14:20:11
@smkngspcmn - `System.Environment.GetEnvironmentVariable("Path");`
Steve Townsend
2010-09-30 14:22:36
@smkngspcmn read about Path environment variable
Eugene Mayevski 'EldoS Corp
2010-09-30 14:23:01
A:
Please don't put it in System32. You will make your install more complicated than it needs to be. Just put it in the same folder as the exe. Save System32 for, you know, system stuff.
Kate Gregory
2010-10-01 11:54:00