views:

221

answers:

3

Hi

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

+1  A: 

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

Jeroen Pluimers
According to info on internet (and here on Stackoverflow) D7 is compatible vith Vista, and programs complied on it (should) run under Vista. Text Processing tool worked well so far.
lyborko
See Lars' answer for more elaboration on this. Delphi 2007 was specifically created to address Vista things. Delphi 7 can be installed in Vista and you can write apps in it that run well on Vista, but you need to do a lot of manual work for it. It is far easier to switch to Delphi 2007 and 3rd party components that support Vista out of the box. That will save you a lot of time.
Jeroen Pluimers
+5  A: 

If Delphi 7 is compatible with Windows Vista, it only really means one or both of the following:

  1. You can run Delphi 7 on Windows Vista
  2. 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.

Lasse V. Karlsen
Thanks for your comprehensive answer. In the meanwhile I recognized my own failure in the program. So it is not Vista issue. I didnot write thread safe code, so functions of Date and time used different formatsettings as I expected and thats why ... Nevertheless the skin component behaves differently, so there is something different deep inside, what I do not control directly. The disquieting question for me is, how to write an applications, which will run on "my sister computer too"... Is there any way how to be on 95% sure, that application doesnot crash on different computer?
lyborko
Extensive testing. Welcome to the world of production quality software. There is, as I said in my answer, no silver bullet. You really need to write robust software that will alert the user to any problems, in such a way that reports you get back from them is more than just "it crashed". For instance, a crash report containing the exception message, a stack trace, etc. will be invaluable. But be prepared to handle bugs, writing bug-free code is extremely hard. You need to strike the right balance of spending time making it robust vs. adding new features.
Lasse V. Karlsen
A: 

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.

Marco van de Voort