VB6: Question about version numbers of dependent OCXs - vb6

Is it important for a VB6 app to refer to certain OCX versions?
I have noticed that if I put my VB6 app code through the IDE on one machine then the form files will refer to different version of some OCXs than if I use another machine.
What is the rule of thumb with this? Is it safe to assume that most of these old OCX versions will be compatible with each other and so I shouldn't worry?
Some of the OCXs in question are:
RICHTX32.OCX v1.1 and v1.2
COMCTL32.OCX v1.2 and v1.3

You should probably install the ocx files your application was created with replacing existing versions only if the version you are installing is newer. Here is a question How can you force VB6 to use the DLLs and OCXs from the app directory? that explains installing all your application files into the same folder and running from there.

Is it important for a VB6 app to refer to certain OCX versions?
Yes, because you are "binding" your code to the interface of the ActiveX control.
What is the rule of thumb with this?
Make sure "Upgrade ActiveX Controls" is checked. Under Project properties, on the General tab.
MSDN Search of "Upgrade ActiveX Controls" at http://social.msdn.microsoft.com/Search/en-US?query=%22Upgrade+ActiveX+Controls%22&ac=8
Is it safe to assume that most of these old OCX versions will be compatible with each other and so I shouldn't worry?
Do not worry. The two controls in question are Microsoft controls. One for the rich-text-box and the other is a wrapper to the Windows common controls. You should have no problems with these controls. (There were issues with the rich-text-control on older versions of Windows, but this has been resolved on Windows NT versions.)
For other ActiveX controls, usually from third-party vendors or in-house, you may have a problem. In your specific case, I would not worry about it, until it happens. This is a very complex subject.
How To Use Project and Binary Compatibility at http://support.microsoft.com/kb/161137
MSDN Search of *Binary compatibility at http://social.msdn.microsoft.com/Search/en-US?query=%22Binary%20compatibility%22&ac=8

It may matter if the changes in versions create "breaking" changes. If on your developer machines it doesn't seem to affect the application in an adverse way you are likely fine on those machines. However, if/when you need to deploy this code to one or more users machines you will also need to make sure these controls are on those machines along with a version that is compatible with your code.
You can create an install package that would wrap up and install the versions you are using to ensure this would not be an issue.

Related

Storing Windows SDKs in source control?

The question is at the end - let me start by posing the context:
One of the problem we are facing at work when using Visual Studio is to make sure that everybody on the team is using the same version of the SDKs.
A typical problem would be to have somebody use a different Direct X SDK version resulting in a different behavior of the code, or somebody upgrading to a more recent Platform/Windows SDK in order to use some new API and having the code fail on other's programmers machines if they still use the previous version.
A way we used to solve the issue for other middleware has been to put the whole set of libraries, include files, tool chains, etc... in our source control system, and have our projects to use these so nobody has to install anything.
We also managed to do that with earlier version of the Direct X SDK, but we always ran into issues with the Windows/Platform SDK due to the close links between the SDK and the toolchain.
Since we now have to support both VS2010 and VS2012, and have to support from Windows XP to Windows 8 targets, we have to support v100, v110 and v110_xp toolsets.
This means that we need all the associated compilers and the corresponding SDKs, both on our developer machines and build systems: This is getting ridiculously costly to maintain, specially considering that random windows updates and .net framework releases routinely tend to break msbuild.
So the question is:
Is it possible to have Visual Studio to use non installed toolsets and SDK and instead having it use whatever is available in some folder out of the normal VS installation locations?
Bonus question: If it is doable, is it possible to do that without having to change any locally installed configuration file on the machine - ie: Have all that in the solution/project or property sheets - so if we change the structure on the source control system we don't have to update every single machine?
Thanks :)
This sounds too complicated, given how complex some of these tool installations are. I would solve this problem by investing in some PowerShell scripts that look at the installed tools and tool paths and "police" the installations. It would be relatively easy to check for installed versions of everything, including patches and updates. You can run those nightly, or as part of a build. Also, you can compare aspects of different installations, such as the tool versions installed on a developer box with your build server.
This would give you 90% of the value for 10% of the pain.
The problems you describe are not solved with your approach. What you actually need is a build server and a definition of done including using binaries built with the build server. You also need a test suite as part of the build definition with some invariants related to the build environment used.

Qt packaging for windows platform

I'm looking for Qt packager for my Qt application targeted for windows platform.
I need it to create a nice installer to deploy and distribute my product on windows PC.
Which is best and recommended FREE packager?
For packaging I use the WIX (Windows Installer XML) toolset.
There are several advantages to using WIX:
Free and open-source
Creates MSI files, which allows your application to be easily deployed across large networks and correctly uninstalls (also very important)
Supported and developed by Microsoft, it is used by several other Microsoft teams internally, e.g the Visual Studio 11 Developer Preview installer features some of the latest WIX features
XML configuration allows reuse of components of installers (sets of files, feature sets)
Several types of user interface, new wizard pages can be created
Integrates into Visual Studio
Integrates into MSBuild - can allow consistent packaging to ensure you don't ship debug versions
I have used WIX for installers at work and for my own projects at home.
It isn't as simple as other solutions to get started, but once you've created a simple package, you'll find it easy to add new features.
NSIS is the way to go in my opinion. Straight forward scripting, compatible with all Microsoft Operating Systems and with support for User Levels.
Plus it has a huge active forum for any specific help you may need. I use the HMNSIS editor to write the scripts and have not come across anything it hasn't been able to do yet!
Qt has nothing that can help you, but the free Windows installer package creator is without a doubt NSIS
Inno Setup is a another good, free, light-weight installer system.
There is the Qt Installer Framework. That is a link to the manual for it. It is multi-platform. With it, you write XML files in a directory structure for delivery of components in the directories, called packages. It has scripting. You then compile it into a setup for your target platform.
Correct me if I'm wrong, but I was under the impression that they did not make it available to users of the Community edition until recent versions. When the earlier replies were written, it may well have been commercial version only.
Alas, nothing seems to warn you that you have to collect up components, nor tell you what they are, or even talk about the process; except that the 3rd. party, but free (Windows only), Dependency Walker can tell you what dynamic libraries are being used. I don't find it a necessity, but it can be helpful. (Tip: On Windows anyway, be sure to put "qwindows.dll" in a "platforms" directory with the exe. Tip #2: Make sure the Qt DLL's or static libraries are ones compiled for your compiler.)

Do I have to apply VB6 SP6 to all DLL projects, of a Windows project?

I've decided to try and give service pack 6 for VB6, a try with our legacy app. I'm hoping it will make the old app work better, with fewer crashes, so that we can continue work on migrating this app to .NET. Anyway, this VB6 app has about a dozen DLL's we wrote, all in VB6, and all compiled with SP5. Do I have to apply VB6 SP6 to all of the DLL projects, as well as the main VB6 Windows application?
Having done a chunk of work through both SP5 and SP6, I don't remember ever having to make code changes to support the service pack.
And yes, you'll have to rebuild all your sources (so all DLLs and executables).
It would be wise to do so as you'll pick up any enhancements in the compiler etc.
Its going back a bit, but I don't think you'll find any major code changes to deal with.

Incuding directories of VS2010 for VS2005

Can I use new SDK directories that comes with VS2010 for VS2005 ?
I expect you can, but unless you need that specific version the simplest thing to do would be to download the latest Windows SDK instead:
Microsoft Windows SDK for Windows 7 and .NET Framework 4
This is more recent and can (IIRC) automatically integrate into VS2005.
If there is going to be an issue with this or with the VS2010 SDK then it will be because the .lib files are incompatible, e.g. through an object file format change or through a whole-program-optimisation intermediate representation change. However most if not all of the .libs in the SDK will just be DLL headers and so this shouldn't be an issue. (In the SDK release notes there is actually a link to a supported hotfix that improves compatibility between VS2005 and VS2008 objects but it sounds like VS2005 SP1 will usually be enough.)
There's a slim chance that the header files might not work (or might assume a different set of default defines) but in general the Windows header files are very careful with defines and version testing that I doubt this would be an issue.
If you're asking if you can use ATL + MFC from the later version then I think this is less clear cut, and may require a recompile of their sources in the older compiler. In that case I think your best option might be to upgrade to VS2010 if that's possible.

VB6 Package and deploy setup ask system restart

I found Vb6 tools package and deployment. I used it and created a package or setup file from my running vista operating system. Later when i tried deploying it in clients computer with winxp, it asks for update of system file and ask to restart. The process never ends just ask for update and restart. how should i create setup file to avoid this problem?
Edit:
If i create setup file in Win98 and deploy it in clients Vista or winxp then it runs fine...
There is a very good chance you are trying to deploy system files that you shouldn't. Typical examples include MSVCRT components.
You receive multiple "System files are out of date" error messages when you install a Visual Basic 6.0 application
Using Win9x can mask the problem because ancient versions are packaged. During installation either setup1 will detect that newer versions are already in place or Windows will fend them off via System File Protection. Vista is much better at this than XP was.
Yes, the PDW is old. For that reason you should seek out the MSKB articles on usage tips, newer information, and on manually updating the files PDW uses as guidance (its REDIST folder, VB6DEP.INI and the .DEP files that accompany many controls).
Best practices for deploying Visual Basic 6.0 applications is a good generalized starting point.
Many of these sorts of issues have been answered over the years since VB6 and the PDW were released.
The VB6 package and deployment tool is really dated. It doesn't play well with some of the new security features.
It's probably trying to install old copies of the VB6 runtimes and then Windows is restoring its own copies.
It's been a while, but can you remove the VB6 runtime files from the files to deploy in the Package and Deployment Wizard? If so, do so. As long as the computer being installed on has the latest service packs it will already have the VB6 runtimes on it.
If that doesn't solve your problem then check what other system files your deployment project has in it. In most cases you won't need to deploy any system files as modern, patched systems should have them all. There are a few activeX controls that may not be on modern systems, but those shouldn't cause these endless restart problems.
Alternatively, try another install technology. You could create a setup project in modern versions of Visual Studio. Alternatively there are some very good open-source and commercial products.
I've used this one quite successfully in the past:
http://nsis.sourceforge.net/Main_Page

Resources