Re: Accessing Unmanaged code from ASP.net



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.

--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com


<admiller97@xxxxxxxxx> wrote in message
news:1130970698.000409.293730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> 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");
> }
>


.