Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2005

Tip: Looking for answers? Try searching our database.

Accessing Unmanaged code from ASP.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
admiller97@gmail.com - 02 Nov 2005 23:31 GMT
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");
>     }

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.