DllImport to unmanaged

  • Thread starter flemming eriksen
  • Start date
F

flemming eriksen

Hello NG

From a Web Project (C#, XP-box) I want to call unmanaged code :

so

[DllImport("mydll.dll", EntryPoint="FirstFunc")]
private static extern int FirstFunc();

BUT when I in my C# prog call FirstFunc(), I get "Unable to load dll
(mydll)"
I have copied mydll.dll from a to b without success.

So where should the dll be located and which access-rights should it be
equiped with?
(haven't found the rules)


Thanks,
flemming
 
P

Paul Glavich [MVP ASP.NET]

It should be in either the /bin directory or in c:\windows\system32
directory. You will need to grant the "interop" permission as well as by
default, web apps cannot access interop code. You can do this via the .Net
framework configuration inthe policy section, and allow interop for the
machine group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top