A question regarding DLLs utilization

I have created an class library (1) that uses a CUSTOM DLL (2) and it is referenced in it properly.

This class library has been built for a “classic asp” legacy website.

I’ll register application dll (1) and CUSTOM DLL (2) on the server.

When i’ll create an object to my application dll (1), and use a method that utilizes CUSTOM DLL (2), will i get into an error or will the object get created and utilized?

If not, then how can i check in my application to see if “using CUSTOM DLL” has infact loaded the dll or not? And also, if not loaded then, how should i load it? I am planning on using this same in one of my MVC websites also where both will get referenced and then utilized without any problem.

Hard to follow your question, but the non-classic ASP app would need a copy of the DLL in it’s bin folder and it should be able to access the methods there. If you want to use the copy you registered you would have to do COM interop, but that makes about zero sense if you are coming from and ultimately going to managed code you control.

Non classic ASP site has both the dlls referenced and its working perfectly fine in there.

For classic asp site, after registering the dlls on the server side, i need to make sure that third party dll is loaded before a method in my dll can utilize it. I would need to do some thing like following but how can i check that the third party dll is loaded via “using” first and if not then import?



Class TestDll
{
  //import your tested DLL here
  [DllImport("kernel32")]     
  public extern static int LoadLibrary(string lpLibFileName);     
}

try
{
  TestDll test = new TestDll();
}
catch(DllNotFoundException ex)
{
  return false;
}
 


Been a long time since I dived into that muckity muck, but classic ASP should not have the problem you are trying to prevent. Call create object, make sure it don’t blow up and that the returned object is not Nothing and you should be good to go.

ok, Thanks.

Now when registering my dll, i am getting into following error.

The module “”%1"" was loaded but the entry-point %2 was not found.

Make sure that “”%1"" is a valid DLL or OCX file and then try again

My machine is 64bit, win 7.

Server is IIS7 and windows server 2008 64 bit.

It failed to register on my local machine also:

The module “NrccuaFileSystem.dll” was loaded but the entry-point DllRegisterServer was not found.

Make sure that “name.dll” is a valid DLL or OCX file and then try again.

c:\Windows\System32>regsvr32 name.dll
c:\Windows\SysWOW64>regsvr32 name.dll