Click to See Complete Forum and Search --> : ActiveX control - "could not be loaded" error
Dave Johnson
October 17th, 2001, 02:06 PM
Hi,
I have been developing an ActiveX control and testing it with a standalone project. Up until yesterday, the second project would update the control at load and run properly.
Sometime yesterday I made a change which now causes the following message when opening the test project: " could not be loaded--Continue Loading Project.
The form error log contents are:
Line 13: Class QSControl.QuickSearch of control ctlQS was not a loaded control class.
If I put the two projects into a group, everything runs fine. I am relatively new to VB ActiveX programming so I don't know how to diagnose the problem.
Any ideas what might be causing the error? (Unfortunately, I don't have a copy of the project prior to the message so I can't compare the two for changes).
Thanks in advance for any assistance!
dave
ilynx
October 17th, 2001, 08:03 PM
when your refer that ocx in the project, you didn't actually refer it to the control but in the project itself. notice that when you see the path of that activex its extension is vbp. therefore if you want to use that ocx work with a stand alone project you must compile it again and add the compiled ocx. :D
Dave Johnson
October 17th, 2001, 08:41 PM
In the control project, I compiled to create the .ocx. In the test project, I added the control (.ocx) and then painted it onto my form. This works and I can close and open the project without problems. However, if I recompile the control (project compatible) and reopen the test project, I get a message about the control being updated then get the " could not be loaded message (note the " is part of the error).
This process used to work but now doesn't. I can remove all of the control properties, recompile and the test project will load. Best I can tell no specific property is the cause and all of these are as they were when things worked.
This is really strange and I just can't figure out what is going on.
ilynx
October 18th, 2001, 04:15 AM
first u must consider what are the things you referred when u created the ocx. my advice for you is. you can still compile the whole project. (compile project group). check for its dependencies without separating them into individual project.
John G Duffy
October 18th, 2001, 09:50 AM
Let me understand. I may be all wet on this.
You have a test project with a user control (.ocx)on it that works.
You recompile the user control then the test program gives you that error message when you try to load it.
If that is the case then you are probably running into versioning problems. Everytime you recompile the .ocx you get a different version registered in the system registry. Since you overlaid the working copy of the .ocx, it no longer exists so when your test program calls for it it can't load it. If you edit the .vbp file using Notepad, you will see a long string of alphanumeric characters that represent this in the statement that describes the .ocx. It may look something like this (Object={5167FF41-1B5F-11D4-BD2C-00A0CC3EEFBB}#33.0#0; XDriveList.ocx)
'
Try playing around with the version compatibility parameters of the .ocx that are on the Project/Properties Componenet tab to disable or at least ignore versioning problems
John G
Dave Johnson
October 18th, 2001, 01:36 PM
John,
That is exactly what is happening. I have disabled auto-increment versions, tried binary vs. project compatible, etc. I'm not sure where else I can ignore these version issues. The line you mentioned is in the .vbp file and also the .frm. The version seems to always increment and doesn't seem related to the project make version settings.
I did notice one additional thing, after getting the message opening the project, if I try to open the form with the user control, I get the following added to the form.log file:
Line 19: The property name _ExtentX in ctlQS is invalid.
Line 20: The property name _ExtentY in ctlQS is invalid.
I assume that is because the user control was changed to the picture control but I'm not sure.
I'm still confused as to why this problem didn't surface until 130+ compiles of the control and testing. To the best of my recollection (I guess that sounds like a response to a senator...) I haven't changed any project properties or what I have been doing all along. However, something has changed and I sure want to find out what...
dave
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.