SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.

  3. #3
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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?

    Code:
    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;
    }
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  4. #4
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,633
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    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.

  5. #5
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.\n\nMake 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.
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...

  6. #6
    Learning...
    Join Date
    Jan 2003
    Posts
    781
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    The beauty of life is not dependent on how happy you are,
    but on how happy others can be because of you...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •