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.
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
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.
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).
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?
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 .
Originally Posted by WoF
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.
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?
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.
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...
Bookmarks