ActiveX Control Versioning VB 6.0 - vb6

I have OCX created using VB 6.0. And this OCX has custom activex controls in it. The custom controls are used in my application. I have installed my application in a system in which I have registered mu first application.
My second application needs the custom controls which are available in my OCX , few enhancements in previous controls and new custom controls.
For this purpose I have created new OCX with previous controls and new control added. In this case in future if I need different controls I need to create more OCX files. This is difficult to maintain different OCX.
If I add new functionalities in the existing OCX and register in the system, already existing application couldn't able to find the previous version of activex control.
How to add new features in already existing ocx with out affecting the applications already using these controls?
Thanks

Publishing a component with "Binary Compatibility" allows this (with several caveats involving what you can safely change) by examining the existing version of the activex control and then re-using IDs from the type library in the new version at compile time.
See here for an explanation: http://wynport.wynsys.net/Visual_Basic_Binary_Compatibility.htm which includes a list of what incremental changes you can make.

When you compile your project, Visual Basic only creates new Class and Interface IDs when necessary. It preserves the class and interface IDs from the previous version(s) so that programs compiled using an earlier version will continue to work. If you are making a change that will result in an incompatible version, Visual Basic will warn you. If you want to maintain compatibility with older, released versions of an ActiveX component.
Ref: http://support.microsoft.com/kb/161137
To make your control binary compatible,
Open the properties dialog of project
Select Component tab
Select Binary Compatibility radio button
Browse your existing control which you have compiled
Click OK button and recompile your project

Related

How to manually set the GUID for a VB6 Activex control

Recently we have an issue where we have to modify an ActiveX control which is developed long back. Problem is, we lost the source code, but we found another version of the same control with a different GUID.
The requirement is to keep the old GUID as other products are using the same control. So we want to replace the new control GUID with old one.
Is it possible? If so please let me know how can I change the GUID of the Active X control in VB6.
You don't manually put the interface & class GUIDs into your application, but in your project settings you need to enable "Binary Compatibility" pointing to a DLL that has the interface & class GUIDs that you want to have your project use.
From the Visual Basic 6.0 Project Documentation Component Tools Guide, "Providing a Reference Point for Binary Version Compatibility":
To specify a reference version of the component type library
Open the project.
From the Project menu, choose Project Properties to open the Project Properties dialog box, and select the Component tab.
Click Binary Compatibility to lock down the class IDs in the project.
Note As explained in "Project Compatibility: Avoiding MISSING References," the Project Compatibility setting actually has nothing to do with the Version Compatibility feature.
Update the box at the bottom of the Version Compatibility frame with the full path and name of the most recent version of your component.
Whenever you make a new executable from your component project, Visual Basic compares the new interfaces of your classes to the ones described in the file you have specified. Visual Basic updates the type library version number according to the level of compatibility between the interfaces.
For more information, be sure to read through all the sections in the "Version Compatibility in ActiveX Components" portion of the documentation.

How can I add a resource to .qmlproject

I have created a new qmlproject using New File or Project… / Applications / Qt Quick 2 UI with Controls. I'd like to add resources (such as image files and fonts) to the project.
When I rightclick on the project, the entry Add Existing Files… is greyed out.
When I choose Add New… / Qt / Qt Resource file, Qt Creator creates a new resource file, but then pops up an error message that the file could not be added to the project.
When I drag an existing file from Finder to the project, Qt Creator open the file in a hex editor, but does not add it to the project.
I could not find any documentation on this, so this is why I would like to know: what is the standard way for adding a resource to a .qmlproject?
I'm using the version of Qt Creator bundled with Qt 5.2.0 beta 1
I don't think you can.
The type of project wizard you chose is documented here:
Qt Quick UI (in the Other Project category) creates a Qt Quick UI project with a single QML file that contains the main view. You can review Qt Quick UI projects in a preview tool and you need not build them. They do not contain any C++ code.
Qt Quick Controls UI is like Qt Quick UI, but using Qt Quick Controls.
The part in bold is key here, because .qrc files must be compiled into the application's executable, which can't happen when you don't have any C++ files to compile. Even if you had external binary resources, there's no QML API to register them as far as I'm aware; only C++.
Newer versions of Creator seem to recommend against it:
Creates a Qt Quick 2 UI project using Qt Quick Controls with a QML entry point. To use it, you need to have a QML runtime environment such as qmlscene set up. Consider using a Qt Quick Controls Application project instead.
I wouldn't recommend using the .qmlproject format. From memory, the last time I tried to deploy such a project to e.g. an Android device, it didn't work. You're better off using the "Qt Quick Application"/"Qt Quick Controls Application" project.

vb6 ocx project - can run EXE directly, not in debugger

I have a VB6 ActiveX control project (creating an .OCX), which has several User Controls. The controls are being loaded by an EXE (also VB6). When I run the EXE directly, it runs OK, but when I try to run it in the debugger (I need to step through the code), it cant't load the user controls (.ctl), gives me "Class not registered. Looking for object with CLSID:..." message
I have the Binary Compatibility set (kept all the old GUIDs), and I see the classes in the registry, everything looks OK - just doesn't run in debugger.
Any help please?
I've been working with VB6 for over a decade now. The problem is that the VBP project reference is out of sync with the latest build of your OCX user control. Simply open the project as a group or the EXE project on it's own and click Project->Components.
You will now see one of two things. Either the reference will be invalid or you have a valid reference chosen. Either way, uncheck the reference and click okay (do not re-select it during this operation.. trust me). Now, close that dialog and go back into Projects->Components, now pick your OCX control from the list. This will solve your problem. If your OCX is not in the list than rebuild it independently first and try again.
This is an undocumented bug with the VB6 IDE. Even with VB6 SP6 it had not been solved.

Overriding the VS2010 Project Invalidated (refreshed) event

I'm trying to override VS2010 behaviour when an external program makes changes to the project or solution files. Atm VS throws a popup asking if you want to reload/save the project files.
I've trying to override this behaviour however I have yet to find a solution. Is there some way to override the event or programatically set VS so it automatically lets external changes refresh active projects?
There are some configuration options available at
Menu Tools - Options - Environment - Documents
Look at the checkbox and other options
Detect when file is changed outside the environment

VBP file tags value

I have open VBP file in notepad and there are differet tags over there like CompatibleMode, Command32, HelpContextID, ServerSupportFiles, CompilationType, OptimizationType, FavorPentiumPro(tm), CodeViewDebugInfo, StartMode.
I wanted to know the meaning of this different tags. Please revert if you have any idea. I found on google but didnt found anything.
All these tags are referring to your project properties.
When opening your project in VB6 goto the "Project" menu and click on "projectname Properties...". From there on the VB6 help can tell you everything you want to know.
For example
Version Compatibility
Allows you to set the level of version compatibility
No Compatibility — Compatibility not enforced.
Project Compatibility — If checked, the Location box is active and
allows you to search for the file with which this project is to be
compatible. If cleared, the Location box is not available. For all
ActiveX project types, Project Compatibility is checked by default.
Binary Compatibility — Useful for maintaining compatibility among
projects that have been compiled using your component.

Resources