Compatibility on WinXP and Vista - delphi

I developed an application using also third party components (developed on D7, WinXP).
When I deploy this application on XP everything works fine. When I run it on Vista, the application cease to work properly:
Toolbuttons on Toolbar does not size equally, when I switch visibility on/off, thats why (third party) skins are not properly nested and then it looks ugly. It bothers, it's annoying but it is not fatal as the next point.
Third party text processing component cease to write. I wrote some routines, which allows writing on this component under certain circumstances. It was a big shock to find out, that I can not write anything (probably these routines return false for writing, but I do not see any reason, why on XP it should work fine, but on Vista not).
The application runs (at last), but not in the way, like it supposed to !!!!
I would like to debug it, but how?
Should I install Delphi 7 on this problematic Vista computer and compile project on it? (this is it, what I am going to do...)
Is it problem of third party components?
Is there any possibility to use some compiler directives to ensure, that application will run on Vista flawless ? (be honest I do not know if Vista is to claim in general).
Is Delphi 7 too old for Vista?
NOTE:
When I run the same application on Win98, I get error message about invalid floating point operation...
Has anybody solved such problem?
Thanks

If Delphi 7 is compatible with Windows Vista, it only really means one or both of the following:
You can run Delphi 7 on Windows Vista
Delphi 7 can be used to write programs that can run on Windows Vista
It does not automatically mean that
All programs I create in Delphi 7 runs on Windows Vista
All programs I create in Delphi 7 runs properly on Windows Vista
Let me give you an analogy: That you can use a hammer to get a nail into your wall without hurting yourself does not mean that no matter what you do, you won't hurt yourself.
If your program, either in your own code, or as part of the third party components you use, use parts of Windows that has changed or possibly even been removed (although that's far less), then you need to fix your program, there's no way around it.
There's no silver bullet either, so no compiler directives or whatnot. The most I can think of is that perhaps Windows Vista has some compatibility settings for the shortcuts that might turn on some XP-compatibility layer in Vista that fixes the particular issues you have.
However, the only long-term solution is to change your program so that it is properly compatible with Windows Vista, and probably Windows 7 as well.
Since you say you're using third-party components, have you verified if the particular versions of them that you use happen to be Vista-compatible? You need to go check on the websites of the authors to find that. Perhaps it can be solved by simply upgrading those components.
However, it might also be that you need to make changes to your own code.
The best way to move forward is to install Vista and possibly Windows 7 and start debugging to try to find the underlying cause of the problems.
Note that just installing Delphi 7 on Vista and recompiling will not fix anything. The compiler does not produce a different program if you compile it on a particular Windows version. Only changes to the code will apply the necessary changes.

The easiest solution is to make sure your Delphi version and 3rd party components are Vista compatible.
Delphi versions since 2007 are.
Recent TMS, DevExpress and Raize components are.
The hard solution is to do all the changes yourself.
Be prepared to modify the VCL sources from 2002, carefully modify them to bring them up to Delphi 2007 level.
Then do the same for your 3rd party components.
--jeroen

I never really investigated, but I noted that in some apps that I have, in all skinned modes (XP-teletubbie, and Vista/W7 non classic) I had paint artifacts with all delphi verrsions if I put buttons and labels directly on tframes or ttabsheets.
The problems went away when I inserted a panel inbetween.

Related

AutoCAD type library not working in Windows 10

I have an ancient program that I use for reading and writing data from AutoCAD. This program is written in Delphi 5. I have tried to update it to a newer release but several of the libraries I use no longer exist and it is a huge program with lots of libraries used.
The program uses the ACAX##ENU.TLB type library that is provided with AutoCAD. Where ## changes for each AutoCAD release. Every time Autodesk sends out a new AutoCAD version I import the new type library and life goes on.
Now I am faced with Windows 10. For some reason the automation links between my program and AutoCAD are not working in Windows 10. Did something change about the way the type libraries work between Windows 7 and Windows 10? Something that Delphi 5 is no longer compatible with? Maybe it's a 16bit vs 32bit vs 64bit issue. That is all over my head but I understand that Windows 10 dropped support for some 16bit operations. But my program itself runs perfectly. Even the BDE can be made to work which is amazing to me.
Is there anything I can do for an experiment? I am really lost about what to even experiment on.
Thanks.
Well, it's been a long time since I asked this question but here is an answer:
I was able to get my Delphi 5 compiled program working with AutoCAD 2017 in a Windows 10 environment. I am pretty sure that the solution was to run the program WITHOUT administrative permissions and WITHOUT any compatibility modes switched on. Apparently Windows places restrictions on COM communications as soon as you turn on either of those features. There may have also been issues with Windows 10 still having UAC active even when you set UAC all the way off. There is a registry setting to actually set UAC to off but my corporate IT prevents turning that off even with admin rights.
So in the end it was not a problem with Delphi, my program or with AutoCAD. It was a Windows 10 problem.
There was a bit of a clue that might be helpful to others: with the admin permission and/or windows XP compatibility turned on the program took several extra seconds to boot. With the settings turned off it booted quickly.
Or maybe its something entirely different from any of this. But the program is working now.
Thanks.

how do you develop and test components for all IDE versions?

The following question has had me wondering for some time now as to how 3rd party component developers are able to ensure there components are compatible with all the various IDE versions?
I am just a single developer who uses Delphi XE and occasionally Lazarus, if I developed some components in Delphi XE how would I ensure they are compatible up to Delphi XE6 for example, and also compatible with older IDEs?
I don't mean in a coding sense because I believe you use the IFDEF flags when checking the Delphi version numbers. I mean if you don't have access to different Delphi versions how do you test the component?
It is not possible for me right now to purchase XE6 or a new Delphi IDE for a while - if it all, and even if I could I would not have previous IDE's like Delphi 5,6,7 etc.
So how do other component developers do it?
Purchase all the IDEs? which seems unlikely
Download Trials for the IDEs? which also seems unlikely
Get people to test the component if they have another IDE? Seems possible
Make it Open Source and let others test it? Also seems possible unless you want it Close Sourced
What it comes down to is I want to make a few simple components but I want them to be compatible with as many Delphi versions as possible should they ever be released to the public.
I don't have the means to get all the Delphi IDE versions and downloading trials may also not be possible. Even if I bought XE6 or the next release I would not be able to test with Delphi 8 for example.
So, how do 3rd party component developers make there components compatible and tested on various IDEs? Am I missing something obvious here, how can you have access to every Delphi IDE Version?
As a component vendor myself (I am the primary developer of Indy) who needs to support multiple versions, I can only speak for myself, but here is how I do it:
Purchase all the IDEs?
If possible, yes. I have a number of IDE versions installed in VMs, which I use for testing purposes. And for some versions that I do not have installed, I do have their RTL source code for reference purposes, at least. On the other hand, as a member of TeamB, I get free IDE licenses, which helps. Not everyone can afford to purchase every version, although newer versions do provide free licenses for older versions, so you should take advantage of that. I recently installed Delphi 7 through this. If a components works in Delphi 7 and Delphi XE6 then there is a good chance it will work in all versions in between (barring any version-specific RTL bugs, etc).
Download Trials for the IDEs?
N/A for me, but that might be a viable option for some people.
Get people to test the component if they have another IDE?
I do this with Indy. Although I do have several versions, I don't have every version. Other users who have versions I don't have myself do help. If nothing else, for setting up version-specific project files and testing install procedures.
Make it Open Source and let others test it?
This also helps. If you want to develop closed-source components, you could setup a private repository and give access to select users/volunteers. Most users want/need source code (to find and fix bugs when used in their projects, to satisfy corporate policy requirements, etc), so you should make sure you offer an option to pay for source code.
When you buy the latest you get access to all the previous versions (from v7 on - thanks Uwe Raabe)
Previous versions
I am using the first approach: Buy all versions. I have all Delphi versions back to version 3 (from 1997), but only 6 to XE6 are installed on my machine (with the exception of Delphi 8 which in my opinion should better be forgotten). But of course I didn't buy them all at the same time, I started with Delphi 3 and updated from there on.
Unfortunately it becomes more and more complicated to get older versions installed and running on "modern" operating systems (currently Windows 8.1 so far) so sooner or later I will be forced to switch to virtual machines. Not yet, though. Switching to VMs has the drawback that you can't batch compile using different Delphi versions:
call CompileForDelphi6.cmd
call CompileForDelphi7.cmd
etc.
like I do for GExperts.

Application portablity between Windows versions

I have an Delphi 7 Application that uses Halcyon dbf component. It works well in Windows ME.
Unfortunately in Windows XP data aware controls which are bound to Halcyon xBase Engine do not behave correctly. In addition pack command almost hangs the application. I tried compiling in XP. But no joy. Does that mean that API calls work differently? May be Data types mean different things....
Thanks for all help
A well written Delphi 7 application will work on any version of WIndows from 98 onwards. If you have managed to make an application that doesn't work on XP, then you should debug the problem on XP, not recompile and then give up. (no joy!? what? you're done already? Is that how you troubleshoot and debug?).
For posterity I should point out that if you change Delphi versions then of course, some things change. For example, If you build your Delphi application in Delphi 2009 or later, it will work properly on Windows XP, but not on Windows 98 or ME any more. But if you build your application using the same version of Delphi, why would you expect any changes in the application's bugs?
As David says; Rebuilding your application on a different computer, from the same code, and with the same compiler, produces the same binary. If you have a fundamental problem on Windows XP it is because you made a mistake in your code somewhere.
In general, windows 98/ME to 2000/XP was an easy transition, but that was a decade ago.
The only API I remember that was in Windows 98/ME that was not in XP, was the Windows 98 text-to-speech API which was removed and replaced with a different API in XP.
I believe your confusion is that windows contains something that affects Data Aware controls. It does not. Data Aware Controls are a purely Delphi thing, and they are not a part of Windows XP, they are 100% implemented inside Delphi. If you have some funny custom control that is badly written, perhaps it might not work. We have no idea what your code contains, and you haven't even described the nature of the failure.
You need to provide more information, or this question should be closed as unanswerable, or too localized. (My app doesn't work! Help! No other info given.)

How do I make TSpeedButton honor Windows themes?

I have an old app (Delphi 5) which I want to give it some changes.
I have set a manifest for it, but speedbuttons are not following the Windows theme. What should I do?
Delphi 5 doesn't know anything about Windows visual styles (no big surprise :-)). If you really want to stay with D5, your best bet is probably to use Mike Lischke's Windows XP Theme Manager.
Your best bet, in my view, is to upgrade to the latest Delphi which fully supports XP themes out of the box. Trying to get a Delphi 5 app to look native on modern Windows is quite a labour (I have done it myself so I speak from experience) and if you can upgrade it will be the least painful route.
Even though this post is not answering directly your question, MAYBE it will help you somehow:
I agree with others that the easy way will be to upgrade to the latest edition of Delphi. However, this is a fast (if you ignore the UNICODE conversion) but not cheap solution. A cheaper solution (and even faster) may be to 'pimp' your application using a Delphi skin package. Your application may look even better than the 'classic' Windows Vista/7 themes.

Supporting Delphi 7 apps in D2006 / D2009

I started occupational programming with Delphi when the Turbos came out , and have licenses for Delphi 2006 Turbo Pro and Delphi 2009 Professional. I have been asked to support another in-house tool, written by another occupational programmer, who has since retired.
It's a Windows program, but it was developed with Delphi 6 using the CLX library rather than the VCL.
From what I gather, the CLX library was QT based and was removed prior to Delphi 2006.The support only consists of a few bug fixes and some minor tweaks, so I would rather not port the code to VCL, if i can avoid it.
Is it possible to install CLX support into either Delphi 2006 or 2009?
Maybe not a direct answer but if you upgrade to Delphi XE, you will also get license keys for some of the older versions of Delphi down to 7, and Delphi 7 included CLX (it was dropped in Borland Delphi 2006).
The short answer is: no. Unfortunately I don't know any long answer which could tell you how to workaround this.
No, you can't add support for CLX to your other Delphi versions.
If it's in-house software, then your company should still have the in-house Delphi installation used to develop it. Multiple Delphi versions can co-exist on the same system; install earlier versions before installing later versions.
If the former employee took that installation with him when he left, can you get it back? I wouldn't expect it really belongs to him anyway. You said he retired; that wasn't a euphemism for died, was it? If not, then you can still contact him.
If there isn't an easy way (and I suspect that there is not), you may need to continue using D7. D2009 is going to introduce the hassle of Unicode, and even going to D2006 is going to cause problems with 3rd-party libraries.
You could run both versions of Delphi on the same machine, but another option would be to use a VM for the legacy development. Either set up a new instance, or you could use the VMWare Converter to convert the other developer's entire machine into a VM image, which you could run on your machine, via the free VMWare Player.
BTW, VMWare Converter is a GREAT way to preserve old environments, to allow maintenance on older software that really needs to use a particular Delphi version, on a particular OS, "just like I left it". If you have a bunch of dusty computers under your desk, consider this option. VMWare Converter is the only tool I know of that will easily convert a physical machine to a useable VM that will run anywhere.

Resources