> I have spent about a week trying to debug a frustrating software bug.
> I've finally discovered that the bug is caused because some computers
[quoted text clipped - 11 lines]
>
> -TC
> > I have spent about a week trying to debug a frustrating software bug.
> > I've finally discovered that the bug is caused because some computers
[quoted text clipped - 45 lines]
>
> -ralph
Ralph,
Thank you for the advice. I now have a clearer picture of what is
happening, and can provide a better description of my problem:
I have two different versions of a COM DLL. The newer version has a
bug which causes my application to fail. The newer version is
installed on the production computer because it has features some
software requires. Therefore, I can't uninstall it or mess with its
registration.
My question is: How can I instruct my software to use the older
version of the COM DLL, without messing with the newer version? If I
register the older DLL, will that invalidate the registration of the
newer DLL? Is there some way in code to ignore the registry and
explicitly reference a specific version of a DLL?
-TC
Brian Muth - 12 Feb 2008 05:33 GMT
My question is: How can I instruct my software to use the older
version of the COM DLL, without messing with the newer version? If I
register the older DLL, will that invalidate the registration of the
newer DLL? Is there some way in code to ignore the registry and
explicitly reference a specific version of a DLL?
----------------------------
Correct. Re-registering the older DLL will overwrite the registry settings. However, you need to restart any applications that are
currently holding on to the previous (newer COM object).
Of course, I'm assuming that you have observed the COM rules of interface immutability and haven't added or subtracted any methods
between these two versions....
Brian
Bob O`Bob - 12 Feb 2008 08:39 GMT
> I have two different versions of a COM DLL. The newer version has a
> bug which causes my application to fail. The newer version is
[quoted text clipped - 7 lines]
> newer DLL? Is there some way in code to ignore the registry and
> explicitly reference a specific version of a DLL?
Why? Why not rewrite your code to overcome the problem, and then
include the newer version as part of your installation?
If it really is the newer version of some other org's DLL, then
there's not much you can do to prevent it getting installed after
whatever steps you might take.
Personally, I think I would be encouraged to get rid of that
dependency altogether, considering that whoever updated it has
"broken it before" ... the only alternative explanation I can
come up with is that your code relies on bugs that have since
been fixed. Either way, you're better off getting rid of the
old one, if not getting entirely away from both.
Bob
--
Schmidt - 16 Feb 2008 13:04 GMT
> I have two different versions of a COM DLL.
> The newer version has a bug which causes my
[quoted text clipped - 3 lines]
> Therefore, I can't uninstall it or mess with its
> registration.
You can use my DirectCOM.dll to achieve
what you need.
This small Standard-Dll offers a GETINSTANCE()-
Call, which can instantiate classes from your
older COM-Dll without the need to register
that Dll (simply place both, DirectCOM.dll
and your OldCOMVersion.dll in your App.Path,
beside your Exe).
Then on your Developer-Machine you should keep
the reference to your older Dll in your VB-Project.
Then you can replace e.g:
Dim oMyObj as cMyDllClass
Set oMyObj = New cMyDllClass
with:
Dim oMyObj as cMyDllClass
Set oMyObj = GEINSTANCE(App.Path & "\MyOlder.dll", _
"cMyDllClass")
You would have to replace all occurences of
'New' or CreateObject-based instantiation inside
your Code with those GetInstance-Calls (for
Classes of your older COM-Dll).
This works earlybound against your older interfaces
(which is compiled into your App on your Dev-PC)
without using the registry in your production-environment.
And that means, the new Dll can sit there and is usable
from other Apps - but your App is using your older
Dll directly from the FileSystem (your App.Path).
DirectCOM.dll is included in my dhRichClient-Demo:
www.datenhaus.de/Downloads/dhRichClientDemo.zip
Olaf