CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    May 1999
    Posts
    19

    regsvr32 problem

    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


  2. #2
    Join Date
    May 1999
    Posts
    30

    Re: regsvr32 problem

    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.


  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: regsvr32 problem

    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.


  4. #4
    Join Date
    May 1999
    Posts
    19

    Re: regsvr32 problem

    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


  5. #5
    Join Date
    May 1999
    Posts
    19

    Re: regsvr32 problem

    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!


  6. #6
    Join Date
    May 1999
    Posts
    30

    Re: regsvr32 problem

    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....


  7. #7
    Join Date
    May 1999
    Posts
    19

    Re: regsvr32 problem - Debugging

    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


  8. #8
    Join Date
    May 1999
    Posts
    19

    New regsvr32 problem

    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


  9. #9
    Join Date
    May 1999
    Location
    Seattle, WA USA
    Posts
    423

    Re: regsvr32 problem - Debugging

    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


  10. #10
    Join Date
    May 1999
    Posts
    19

    Re: regsvr32 problem - Debugging

    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


  11. #11
    Join Date
    May 1999
    Location
    Seattle, WA USA
    Posts
    423

    Re: New regsvr32 problem

    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


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured