Unable to load DLL

S

Sunil Menon

Dear All,
I am writing an ASP.Net application that needs to call a C++ dll.
There are two problems that I am facing...
1. There are two dlls one.dll & two.dll. Using DllImport I call
one.dll's function. It works well. But when I call two.dll's function
it say "cannot Load DLL two.dll". Two.dll depends on one.dll. Can it
be that since asp.net has loaded one.dll, two.dll is failing?
2. After one.dll is loaded other applications cannot call functions
of one.dll it give error "Object reference not set to instance of an
Object". What is going wrong?

Please advice.

TALIA
Many Regards
Sunil
 
N

Natty Gur

Hi,

Can you elaborate on the c++ dlls nature, are they COM or win32 dlls.
There is no limitation to the number of dlls that you can use from your
application. I need to see some code in order to say more.

Anyway I think it's better to encapsulate those DLLs with .Net
assemblies and reference those .net assemblies form your ASP.NET
application.

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
S

Sunil Menon

Dear Natty,
Thanks for replying....they are win32 dlls (Centura dll cdi11.dll &
Sal.dll), how can I encapsulate these dlls with .net assemblies? I
cannot create an interop assembly from a win32 dll.
internal const string CBDLL = @"cdi11.dll";

[DllImport(CBDLL)]
private static extern IntPtr StringGetBuf(IntPtr Handle, ref int
BufLen);

internal const string SalDLL = @"Sal.dll";
[DllImport(SalDLL)]
internal static extern bool StrCompress(IntPtr Value, int i, ref
IntPtr Value1);

This works well in a console application, without givin eny errors.

Please help

TALIA
Many Regards
Sunil
 
N

Natty Gur

Hi,

I suggest encapsulation to separate the Interop from the web application
(design issue), Just put them in different assembly.

Usually, when code/sub program works fine from win application and throw
exception from web application its security issue. I don’t know what
your dlls are doing but maybe you try to accomplish something that the
default asp.net user don’t got rights for. You can test if it's security
issue by using identity tag in web.config. Set its username and password
to administrator and check it up. Remember to remove the administrator
user since it's huge security hole!

Natty Gur[MVP]
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
S

Sunil Menon

I suggest encapsulation to separate the Interop from the web application
(design issue), Just put them in different assembly.
This means I create a Active-X VB 6.0 dll and create an interop of
this dll that calls the dll?
Usually, when code/sub program works fine from win application and throw
exception from web application its security issue. I don?t know what
your dlls are doing but maybe you try to accomplish something that the
default asp.net user don?t got rights for. You can test if it's security
issue by using identity tag in web.config. Set its username and password
to administrator and check it up. Remember to remove the administrator
user since it's huge security hole!
But one thing that suprises me is that the one dll's function is
executed but the other dll is Not found? Both dlls reside in the bin
directory...I also tried to put the dlls in the System32.dll...Does
this mean that the dll is doing something that raises an security
issue? But how come it is giving error "Dll not Found"...suprising...I
will try the suggestion given by you...

Thanks & Regards
Sunil
 

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,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top