2

We have a VB6 application that uses a COM object to communicate with an email package. The app runs autonomously and every once in a blue moon the COM DLL seems to become unregistered. A quick call to RegSvr32 and the system is back to happy. We tried implementing a quick fix that registers the DLL every time the application is going to need it, but that doesn’t seem to have worked.
This has become quite an annoyance.

In case you are wondering the app just calls a shell command.

Shell "regsvr32 /s " & """" & pathName & """"

Does anyone have a idea of what can cause a COM DLL to become unregistered?

4 Answers 4

3

I've seen strange things happen with COM DLLs due to virus scanners and anti-spyware software. If you can, try disabling these apps if you have them.

1
  • I'll have to set up a lab for this test but it's worth doing. Nothing is going on our network without a Virus Scanner though. So if it is the case I'm not sure what to do other than try another scanner.
    – Dan Blair
    May 11, 2009 at 15:02
1

Just a guess but is the DLL, or more likely another version of the same DLL, being registered at different file location? For a COM DLL if it were the same version and were being called normally (by GUID or name) it shouldn't matter, I don't think, but worth checking.

1
  • This shouldn't be the case, the DLL is compiled such that it shouldn't matter, but I'll do a search for earlier versions.
    – Dan Blair
    May 11, 2009 at 15:06
1

I do have a solution to this problem now. The email package is Outlook and that is key to the issue. The COM object was not actually becoming unregistered in the system it was failing to load in Outlook which seems to be a more common occurance, though still rare. Apparently there are some odd situations where outlook will just stop loading COM add ins all together.

For a link to a KB article KB945743

The solution is to unload the COM object from Outlook and reload it.

2
  • Yeah - what I've run into in the past is that when an add-in to to any of the different Office apps throws an exception that is unhandled, the Office app will automatically disable the add-in from loading. So make sure that you have exception catches all the way up at the top of the add-in interface methods. Aug 19, 2009 at 17:56
  • I think you should accept your own answer here? Jun 3, 2011 at 1:45
1

OR something is unregistering it or another version newer or older of the same com object is running and autoregistering the com in the same path of the executable, this is weird but this can occur

And one of them will not run if both applications are executed, one will fail

VB6 com files are autoregistered if the com file is in the same path of the executable

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .