Help Request: "Class not Registered" !
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Help Request: "Class not Registered" !

  1. #1
    Join Date
    Jun 2010
    Posts
    5

    Help Request: "Class not Registered" !

    Greetings,
    I get this error after having run, from within the IDE, an application
    which contains an OCX of mine (developed in VC and using MFC).
    Please note that the component is regularly
    recognized and can be added to the project toolbox. So I can use it
    in my project and can even run the project a first time, without
    problems. But when the program terminates, while going back to the development
    environment VB produces the above mentioned error. The only solution
    I have found, so far, is to exit the IDE and restart it, add agan the OCX to the
    toolbox, etc.

  2. #2
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,722

    Re: Help Request: "Class not Registered" !

    Maybe by any chance the UnregisterServer() function of your ocx is called?
    After program termination, is the ocx still available in the toolbox?

  3. #3
    Join Date
    Jun 2010
    Posts
    5

    Re: Help Request: "Class not Registered" !

    First of all thx Wof for the interest on this question.
    We have looked forward on the UnregisterServer() but is not interested on the normal run of the ocx (proof of it is that after we close VB6 and re-open it the ocx control is still present on the component menu also).
    About the second question, the answer is yes, the ocx is still available in the toolbox after the program termination, but of course is not more usable in any form due to the "Class not Registered " error.
    We all focused on this problem.
    GheoOp

  4. #4
    DataMiser is offline Super Moderator Power Poster
    Join Date
    Jul 2008
    Location
    WV
    Posts
    4,838

    Re: Help Request: "Class not Registered" !

    Interesting problem..

    Is there by any chance some code in the ocx that may reference an object or class upon termination of the program? It almost sounds as if something to do with the OCX shutdown is not registered on the system and is causing VB to remove it during the current session.
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jun 2010
    Posts
    5

    Re: Help Request: "Class not Registered" !

    Thanks also to you DataMiser,
    We actually try to debugging the OCX in the register and unregister function, watching the output on exit too. About probable reference to an object or class upon termination of the program we can almost say that is all clean, nothing more then some wrong releasing of memory in a part of our OCX (is divided in 3 main parts, but also after an not so easy operation of separation of those , our "Class not Registered" error still comes).

  6. #6
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,722

    Re: Help Request: "Class not Registered" !

    But you cannot say for sure which class it is, that is not registered?
    Does the ocx code pop the error is it issued by the VB part?
    I'd also think that the ocx is referring to some unregistered object...
    If it was within the VB code, do you have a code line/statement which produces the error?

  7. #7
    Join Date
    Jun 2010
    Posts
    5

    Re: Help Request: "Class not Registered" !

    Quote Originally Posted by WoF View Post
    But you cannot say for sure which class it is, that is not registered?
    Not really WoF, i can be definitely sure that the class not registered is exactly our control OCX, in fact, after the first execution of the program, during the return from the run state to again the design mode, we received the first pop error window of "Class not Registered" type and we will receive it every time we will now on (until closing the entire VB6 ) trying to re-insert the ocx on the form by draging it from the toolbox.
    So we can obtain an indirect proof of what "class not registered" is it .



    Quote Originally Posted by WoF View Post
    Does the ocx code pop the error is it issued by the VB part?

    I'd also think that the ocx is referring to some unregistered object...
    If it was within the VB code, do you have a code line/statement which produces the error?
    Unfortunately, the only thing VB produce is a really useless and poor log. When the control load failure appear VB6 create this file (form1.log) with only a simple string which report:
    " Line 21: Cannot load control GheoViewControl1 " . This is all we can get from Vb, if we can name it as "helpful information" .

    GheoOp.
    Last edited by GheoOp; June 25th, 2010 at 03:46 AM.

  8. #8
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,722

    Re: Help Request: "Class not Registered" !

    This is really weird...
    VB seems to forget that this ocx has been registered.
    How can we check?
    What happens after program termination (and after receiving the error) if you open Project->Components?
    Is the ocx still checked in the list of components?

  9. #9
    Join Date
    Jun 2010
    Posts
    5

    Re: Help Request: "Class not Registered" !

    After the program termination and "Class not Reg" error we will receive the same mex just on the simple click over the ocx icon in the toolbox ( because the ocx still be checked and charged among components) making us not able to use it anyway.
    No news from the memory testing front.

  10. #10
    Join Date
    Jul 2006
    Location
    Germany
    Posts
    3,722

    Re: Help Request: "Class not Registered" !

    what happens if, after program termination due to error, you open the component list and uncheckt the ocx.
    Then close and reopen the component list and see if the ocx is still available to be checked again.
    If the component was unregistered during program temrination it will not be available anymore...

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center