Question : use environment special folder  to get DllImport

Hello, I am developing on xp for xp,vista,win7. I have a dll that I want to use [DllImport()] on but I cant figure out how to access it from different computers.
I have tried
const string GCSamlibstring = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Lionhead\\Lion's Eye\\Lib\\GCSamlib.dll";

but DllImport requires a constant location. This would be fine but the above code reffers to different locations between xp and windows7.

Answer : use environment special folder  to get DllImport


I advice you to either keep that dll in the same folder as the rest of your application, or have a .Net assembly in the same directory as the dll you want to use DllImport on. Then you can use dynamic loading by using reflection on the assembly that you use as an interface between your code and that assembly.
Random Solutions  
 
programming4us programming4us