To upgrade to XE4 or not to?

This is the forum for general discussion.

Moderator: 2ffat

Re: To upgrade to XE4 or not to?

Postby rlebeau » Fri Sep 20, 2013 1:13 pm

pidgi2009 wrote:No, it definitly does not work.
I will try something else.


Something is not right. What are the EXACT steps you are taking? Do you have Runtime packages enabled or disabled?
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1399
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: To upgrade to XE4 or not to?

Postby minas » Fri Sep 20, 2013 1:54 pm

you may try the following ...

in the very first line in your source code (project file source code) add the

#define _WIN32_WINT 0x0500

this will give compile time errors for API function calls that are not available in Windows 2000 (value 0x0500)

The error will show the source line where the unavailable function is used

HTH
-
User avatar
minas
BCBJ Guru
BCBJ Guru
 
Posts: 196
Joined: Sat Jul 10, 2004 6:09 am
Location: Greece

Re: To upgrade to XE4 or not to?

Postby pidgi2009 » Sat Sep 21, 2013 8:23 am

@gambit47: Here are the steps I used:
1- load the very same project in XE4 instead of XE2, both (XE2 and XE4) installed on the same computer.

2- Go to 'C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\source\rtl\win', find the Winapi.Windows.pas file, make o copy of it, then open the Winapi.Windows.pas file itself (not the copy), find the following line:

function GetSystemTimes; external kernel32 name 'GetSystemTimes';
and modify it as
function GetSystemTimes; external kernel32 name 'GetSystemTimes' delayed;

3- save the file, then add it to my project (using the Project->Add from the menu).
4- rebuild all the project, making sure the Project-Òptions->Packages->Runtime packages is set as false.
5- Using the new .exe file at work, I notice that it does work on the stations that are running Windows XP SP2, but most stations use a Citrix session, which is running Windows 2000, and the program does not run on those last, with a message stating that the entry point of GetSystemTimes() is not found in the Kernell.

@minas
One of the project, the simplest, is named ListeDeGarde, thus the main file is ListeDeGarde.cpp. I add the #define you showed as the very first line, above the #include <vcl.h>, rebuilt all, no spurious message. BUT, (there is always a BUT) with or without that #define, as I recompile there are a few dozen lines stating that:
"[DCC Avertissement] Winapi.Windows.pas(33698): W1002 Le symbole 'DELAYED' est spécifique à une plate-forme"
(Sorry, my system is in French).

I do use a few third party components in my project, namely LMD, JVCL, and Indy components. But on this project, only LMD components.
pidgi2009
BCBJ Veteran
BCBJ Veteran
 
Posts: 52
Joined: Sat Apr 25, 2009 11:44 am

Re: To upgrade to XE4 or not to?

Postby minas » Sat Sep 21, 2013 12:12 pm

the good news are that W1002 is a warning[Avertissement in French] not an error... :-)

so , the ListeDeGard.exe did it to run under Windows 2000?
-
User avatar
minas
BCBJ Guru
BCBJ Guru
 
Posts: 196
Joined: Sat Jul 10, 2004 6:09 am
Location: Greece

Re: To upgrade to XE4 or not to?

Postby pidgi2009 » Sun Sep 22, 2013 9:53 am

That is my understanding, that the message is only a warning. But maybe it could mean that Windows 2000 does not support the 'delayed' directive?
No, it does not run in Windows 2000
pidgi2009
BCBJ Veteran
BCBJ Veteran
 
Posts: 52
Joined: Sat Apr 25, 2009 11:44 am

Re: To upgrade to XE4 or not to?

Postby minas » Sun Sep 22, 2013 12:27 pm

a simple XE4-compiled application ,without any additional component library(like LMD) does it run in window 2000(with or without #define _WIN32_WINNT 0x0500)?

I haven't either , XE4 - Win2000 to try all these ...
In the case of ListeDeGard.exe the error message in runtime, was about GetSystemTimes?
-
User avatar
minas
BCBJ Guru
BCBJ Guru
 
Posts: 196
Joined: Sat Jul 10, 2004 6:09 am
Location: Greece

Re: To upgrade to XE4 or not to?

Postby rlebeau » Mon Sep 23, 2013 10:28 am

pidgi2009 wrote:Here are the steps I used:
1- load the very same project in XE4 instead of XE2, both (XE2 and XE4) installed on the same computer.


Don't open older projects in newer IDE versions. The migration rarely works correctly. Create a new project in the newer version, then add your existing source files to it as needed.

pidgi2009 wrote:2- Go to 'C:\Program Files (x86)\Embarcadero\RAD Studio\11.0\source\rtl\win', find the Winapi.Windows.pas file, make o copy of it, then open the Winapi.Windows.pas file itself (not the copy), find the following line:

function GetSystemTimes; external kernel32 name 'GetSystemTimes';
and modify it as
function GetSystemTimes; external kernel32 name 'GetSystemTimes' delayed;


This is wrong. You must modify the copy, not the original (and you should save the copy into your app's source folder, don't leave it in the original folder, and do not rename the file either), and then add the modified copy to your project so it gets compiled and linked into your executable.

pidgi2009 wrote:5- Using the new .exe file at work, I notice that it does work on the stations that are running Windows XP SP2


Because GetSystemTimes() exists in XP SP2, so you would not see an error about it, even if your app is still static linking to it instead of delay-loading it.

pidgi2009 wrote:but most stations use a Citrix session, which is running Windows 2000, and the program does not run on those last with a message stating that the entry point of GetSystemTimes() is not found in the Kernell.


That proves that your app is still static linking to GetSystemTimes() instead of delay loading it.

pidgi2009 wrote:One of the project, the simplest, is named ListeDeGarde, thus the main file is ListeDeGarde.cpp. I add the #define you showed as the very first line, above the #include <vcl.h>, rebuilt all, no spurious message.


minas's suggest has no effect in this situation, as the problem originates from Delphi code, not C++ code.

pidgi2009 wrote:BUT, (there is always a BUT) with or without that #define, as I recompile there are a few dozen lines stating that:
"[DCC Avertissement] Winapi.Windows.pas(33698): W1002 Le symbole 'DELAYED' est spécifique à une plate-forme"


That translates as "The 'DELAYED' symbol is platform-specific". That is just a warning, not an error.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1399
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: To upgrade to XE4 or not to?

Postby rlebeau » Mon Sep 23, 2013 10:29 am

pidgi2009 wrote:That is my understanding, that the message is only a warning. But maybe it could mean that Windows 2000 does not support the 'delayed' directive?


'delayed' is a compiler/linker feature that is implemented by the RTL at runtime. The OS does not know anything about it. The warning is simply telling you that 'delayed' is not a cross platform feature, should you want to compile your code for multiple platforms, that is all.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1399
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Re: To upgrade to XE4 or not to?

Postby pidgi2009 » Tue Sep 24, 2013 5:05 am

@gambit47: OK, did what you suggest, rebuilt, will try it at work today. Update tonight.
pidgi2009
BCBJ Veteran
BCBJ Veteran
 
Posts: 52
Joined: Sat Apr 25, 2009 11:44 am

Re: To upgrade to XE4 or not to?

Postby pidgi2009 » Wed Sep 25, 2013 5:56 pm

Nope, exactly same message, stating that the entry point of GetSystemTimes() is impossible to find in the Kernell dll.
I will once again redo everything from scratch once again tonight and retry my application tomorrow, but until I do find a good and effective workaround, my advice would be to stay away from XE4 if you plan to build applications for older systems (and they are plenty, everywhere, sorry Embarcadero).
If that is not working tomorrow, I will uninstall XE4 from my system, and I have already decided not to 'upgrade' (?) to XE5, and to keep from renewing my support plan from Embarcadero.
pidgi2009
BCBJ Veteran
BCBJ Veteran
 
Posts: 52
Joined: Sat Apr 25, 2009 11:44 am

Re: To upgrade to XE4 or not to?

Postby rlebeau » Wed Sep 25, 2013 7:29 pm

pidgi2009 wrote:Nope, exactly same message, stating that the entry point of GetSystemTimes() is impossible to find in the Kernell dll.


Then your changes are not being compiled into your app, unless something else in your app is using Windows.GetSystemTimes() statically outside of TThread.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1399
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA

Previous

Return to General

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest