Help Needed...its urgent plz

S

shashank.aka.invi

Hi someone plz help me. I have made a dll in VC++ .NET using following
specifications

extern "C"
{
__declspec(dllexport) void Probe_Interfaces_Local()
{
//some code
}

}

i compiled it successfully and add the dll formed to another C# project
directory. The c# code looks like this...

using System;
using System.Runtime.InteropServices;

namespace read
{
class Capture
{
[DllImport("mod2.dll")]
public static extern void Probe_Interfaces_Local();
//some code
}
}

The C# project compiles successfully but when i run it it breaks with
dll exception and says unable to load dll(mod2.dll)

Please help somebody......u can also mail at (e-mail address removed)
 
V

Vladimir Nesterovsky

Hi someone plz help me. I have made a dll in VC++ .NET using following
specifications

extern "C"
{
__declspec(dllexport) void Probe_Interfaces_Local()
{
//some code
}

}

i compiled it successfully and add the dll formed to another C# project
directory. The c# code looks like this...

using System;
using System.Runtime.InteropServices;

namespace read
{
class Capture
{
[DllImport("mod2.dll")]
public static extern void Probe_Interfaces_Local();
//some code
}
}

The C# project compiles successfully but when i run it it breaks with
dll exception and says unable to load dll(mod2.dll)

Please help somebody......u can also mail at (e-mail address removed)

Put "mod2.dll" near the C# assembly.
 
H

Holger Grund

The C# project compiles successfully but when i run it it breaks with
dll exception and says unable to load dll(mod2.dll)
If you compiled mod2.dll with /MD (shared CRT) you need
a manifest. See the /manifestdependency and /manifest switches
and the MT tool.

With the mixed mode debugger you can also enable LDR
notifications (e.g. with gflags or via the _ShowSnaps
symbol in ntdll.dll). The debugger output will contain
additional information for the LoadLibrary call.

-hg
 
B

Bruno van Dooren

that probably means that your application cannot find the dll at runtime.
it should be in the same folder as your application, or its containing
folder should be listed in the path variable.

kind regards,
Bruno.
 

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

Top