I've got some code to access an unmanaged dll, and it works fine in a
windows based app, but when I move the code to a web application it
does not work. It does not throw an error, it acts like the code never
gets called.
private class dllWrap
{
[DllImport("C:\\ProcessCommand.dll")]
public static extern void ProcessCommand(IntPtr str);
}
private void SendCmd(string command)
{
IntPtr str = Marshal.StringToHGlobalAnsi(command);
dllWrap.ProcessCommand(str);
}
protected void Button1_Click(object sender, EventArgs e)
{
this.SendCmd("WORKED");
}
Vadym Stetsyak - 03 Nov 2005 18:26 GMT
in the web application context you may have no access to
C:\ProcessCommand.dll
Try to put this dll into the same folder where .net assembly you're
p/invoking from is located.

Signature
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
> I've got some code to access an unmanaged dll, and it works fine in a
> windows based app, but when I move the code to a web application it
[quoted text clipped - 15 lines]
> this.SendCmd("WORKED");
> }