#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    0

    Can i use 2 dll with same name ?


    I have a dll that is written i think in delphi

    i have two versions

    version 1 has a bug

    version 2 has the bug fixed but has a different bug

    between the two of them we have all the working code i need

    can i use them both ? i have tried to rename the second one and link to it for some of the functions - but am getting strange results

    can it be done ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    It depends.
    Given your strange results the answer would appear to be no.

    I do not want to be dogmatic here because there are probably factors involved beyond
    my personal knowledge; but I believe the following is a generally true explanation:

    If the DLL is stateless then you should be able to do what you are attempting.
    However, if the DLL maintains any sort of internal state then you are going to get
    strange results at best and "glorious" crashes at worst.

    HTH

    Clive.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    0
    Hi Clive

    thanks for the reply

    what does stateless mean ?

    is a delphi dll a true dll or an activex/ocx ?
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    A Delphi DLL is a DLL.
    An ActiveX or ocx is a special DLL (and can also be created in Delphi).

    Stateless means that the DLL has no internal state.
    OK. I know that might seem circular so let me explain more.

    In your simple situation, it means that every call you make to the DLL is entirely self
    contained and has no dependencies on any calls that have preceded it or on any code
    that might have run when the DLL was first loaded.

    Simple Example:

    Let us assume a document scanning DLL called scan.dll.

    To scan you might have to make two calls:
    1. LoadThisScanner('CANON');
    2. Scan;

    Obviously, if you loaded a second copy of scan.dll (renamed to scan2.dll) and sent
    LoadThisScanner('CANON'); to scan.dll and
    Scan; to scan2.dll you will be in trouble.

    That is one explanation of having state.

    HTH,

    Clive
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    3
    Rep Power
    0
    Hi Clive

    thanks for the explanation - it makes sense

    i suspect you are correct

    i will make multiple exe's where i swap over one function at a time and observe the results

    thanks again

    G.

IMN logo majestic logo threadwatch logo seochat tools logo