ok... now this is something new for me..
I have a utility.dll file which is in my bin folder and i am accessing it in my current application. This part is working fine....
public partial class Reports1 : System.Web.UI.Page
{
[DllImport("Utility.dll")]
public static extern bool GetErrorString(uint lookupCode, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder buf, uint bufSize);
}
But now i have to use .dll from a folder not in the bin but some other folder in the C:/
I tried using registery key in which i stored the path of the folder in a registery key and get that path and put it in place of Utility.dll but this did not work.... I got an error message An attribute must be a constant expression of an attribute parameter type....
public partial class Reports1 : System.Web.UI.Page
{
private static string PathName
{
get
{
using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(@"Software/Copium"))
{
return (string)registryKey.GetValue("BinDir");
}
}
}
[DllImport(PathName)]
public static extern bool GetErrorString(uint lookupCode, [MarshalAs(UnmanagedType.LPWStr)] StringBuilder buf, uint bufSize);
Naybody with any suggestions... Thanks.