By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,480 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,480 IT Pros & Developers. It's quick & easy.

Help Needed...its urgent plz

P: n/a
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 kn***********@yahoo.co.in

Dec 29 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

<sh***************@gmail.com> ???????/???????? ? ???????? ?????????:
news:11**********************@z14g2000cwz.googlegr oups.com...
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 kn***********@yahoo.co.in


Put "mod2.dll" near the C# assembly.
Dec 29 '05 #2

P: n/a
<sh***************@gmail.com> wrote

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
Dec 29 '05 #3

P: n/a
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.
<sh***************@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
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 kn***********@yahoo.co.in

Dec 30 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.