Re: A problem with GUID??!!
Just give a try boss!!!
You recompile the OCX project and then add it to your current project and compile your current project...
May god help you in that way...
let me know too
Santulan
Re: A problem with GUID??!!
Welcome to the wonderful world of Binary Compatibility.
When you compile your program with 'No Compatibililty' a new GUID is created each time it is compiled, hence when you change something in the project and recompile, you get a different version number.
The old VB5 Books-On-Line had a good section on binary compatibility and how to use it (I haven't checked the MSDN that comes with Vb6 as it's a PITB to install on my home machine).
The problems you're having with your client are because it no longer knows about the interface of your component. what you should do is :
1. Load the client project
2. Ignore errors that say 'component xxx couldn't be loaded'
3. goto project->components (or references if it's a dll) and uncheck the missing reference / add in the new version of your component.
4. save only the project file (vbp) and quit from vb
5. reload your project and all the references should be in place.
You still need to understand Binary compatibility though and a good read through the MSDN is always ideal - You should basically develop your ActiveX Components / Controls as such :
1. When you are (dead) sure that it's done and tested, compile the active x component, eg. mycomponent.ocx
2. Copy the mycomponent.ocx to a new file called mycomponent.cmp (extension isn't important)
3. In your project properties, mark the project as being Binary compatible with the new 'mycomponent.cmp' file.
4. recompile your project (just to make sure).
Now your main EXE program can always reference the activex component as long as you don't break compatibility - see the msdn for a list of possible ways you can do this (changing interfaces, removing routines, renaming projects etc).
Should you need to change your component in the future, as long as you haven't broken compatibility then you can just ship the new ocx/dll to your users.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Solved: A problem with GUID??!!
This is in reference to Mr. Chris Eastwood's reply to the post "A problem with GUID??!!".
As enumerated in his recommended procedure to solve this problem, he stated in Step # 3 this: "go to Project->Components and uncheck the missing reference. Add in the new version of your component."
I couldn't find a MISSING message in the Project->Components dialog. But my OCX is listed although it is not selected (no check mark). I did the following steps:
1. Load the project group and ignore the error messages
2. Compile OCX project using NO COMPATIBILITY option
3. Save the OCX project and quit VB6 IDE.
4. Load VB6 and open the project group.
5. Highlight the main project (not the OCX project) from Project Explorer.
6. Go to Project->Components then check the OCX
7. Save the main project.
8. Quit VB6 IDE.
And behold! The next time I reloaded my project in the VB6 IDE, all the references were perfectly in place - no form loading errors appeared anymore. I got my senses back again.
But when I tried to compile the main project, the same problem came up. I keep on getting the same compilation error as before: "Method or data member not found". The error points at an instance of the custom control.
When I press SHIFT-F2 (go to definition) while the cursor was positioned in the wayward instance of the custom control, I get the following error message:
"Cannot jump to ctlXXX because it is hidden"
It was then when I noticed that all instances of the custom control in the form were dimmed (or grayed out). And horror of horrors! After thorough scrutiny I found out that the instance of my custom controls were all redefined as PictureBox. What a great miracle (or could it be Microsoft magic?).
Magic or no magic, that would sure make you scream. (I'm sure I didn't accidentally make the redefinition of the controls myself - not even during my fit of temporary insanity, LOL!).
Anyways, I did solve the problem in no time at all. I got the backup copy. What a brilliant solution, isn't it?
If I never had the backup, how can I put those unwanted PictureBox controls back to their original definitions (and glory)? Please, don't tell me that I have to create the form again.
Is there a way to get back the original control definitions?