Click to See Complete Forum and Search --> : regsvr32 problem


beren
July 14th, 1999, 04:22 AM
Hi. I'm developing an ActiveX control, and after compiling and linking in a build, it will be registered. Only problem is that regsvr32 crashes when trying to register it, saying:

Debug Assertion Failed!
Program: C:\WINNT\system32\regsvr32.exe
File: ctlreg.cpp
Line: 520

For more info etc, etc, etc.

After hitting retry twice, though, it usually works. Any ideas of what I might have written to cause this? I have been working with the control alone and just added a few constant variables which are initialized when the component starts.

Sincerely yours

Niklas

Robert Rolls
July 14th, 1999, 04:51 AM
I beleive it's a problem when trying to register your type library - a loadstring is failing? run your ocx and use regsrv32 as your executable... to hlp debug it.

Lothar Haensler
July 14th, 1999, 04:56 AM
may be regsvr32 is broken.
You can load your OCX yourself using LoadLibrary and call GetProcAddress to obtain the address of DLLSelfRegister and call that function from another program.

beren
July 14th, 1999, 05:27 AM
Actually, it looks as though it's LoadLibrary which is failing. On my compter it succeeded after two retried, but the same procedure at a computer which did not have the component in the registry in advance resulted in an error code in hex equalling 998 in decimal

beren
July 14th, 1999, 05:30 AM
What do you mean by 'run your ocx and use regsrv32 as your executable'? I used regsrv32 to register my ocx. Which is exactly where my problem was, as it crashes!

Robert Rolls
July 14th, 1999, 05:32 AM
compile your progrm in debug .... put a brek point point in your register function .... run the application .. when it asks you for an executable type regsvr32 .... or close to that sequence of envents....

beren
July 14th, 1999, 05:56 AM
Great, thanks a lot. I've debugged it now and come to a function which has been generated for me, BOOL CStylePropertyPage::CStylePropertyPageFactory::UpdateRegistry(BOOL bRegister)

In this, there is a little comment: // TODO: Define string resource for page type; replace '0' below with ID.

What string resource is it talking about? Is it just any string, or some special?

Sincerely yours

Niklas Saers

beren
July 14th, 1999, 08:27 AM
Ok, first part tracked down. But now I've got a very curious problem: On 3 of 8 computers I've tried, regsvr32 installs my component perfectly. However, on 5 others, it doesn't. These are all different settups being Win98, NT4 and Win2kb2. On the ones that don't, three get LoadLibrary failure with each their own error code, and two get assert faults (which won't go to debug-mode when I hit the retry button as suggested). Now I'm TOTALLY confused. And it doesn't change on one computer either. If I restart the regsvr32, it'll report the same error code as it did last time. Help!

Sincerely yours

Niklas Saers

chiuyan
July 14th, 1999, 09:19 AM
does it have some code that looks like return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
m_clsid, 0);

?
If so, just define a string resource (it can say anything you want) and put its ID in place of the zero.

HTH
--michael

beren
July 14th, 1999, 09:23 AM
Thank you very much. That was exactly what I tried :) , and I got a bit further (3/8 further ;) ) as described in the 'New regsvr32 problem' posting.

Sincerely yours

Niklas Saers

chiuyan
July 14th, 1999, 09:31 AM
use the error lookup tool to find out what the errors are, and run depends.exe to make sure that all the files you component depends on are present (and of the right version) on each machine. Compare all those files to the files on the machines that it does work on, to see what the differences are. It is really just a "trial and error" kind of approach, but there is not really any better way of going about it.

If you want to debug those asserts on each machine, you are going to have to build a debug version of your component & install the .pdb files & source files with it, & of course you need Visual C on all the machines & it has to be registered as the debug tool (if it is the only compiler installed, it will be).

HTH
--michael