-2

I am using Delphi Xe5 for both windows and Firemonkey mobile applications.

I have a unit I share among two different projects in my projects group. (Windows Application and a Firemonkey Mobile Application)

1.) How do I determine the version of Delphi Xe5 ? Or, what is the version?

2.) Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application

3.) In code, how do I tell the compiler which version of Dialogs to use based on the type of my app. That is VCL.Dialogs (Windows App) versus FMX.Dialogs (Firemonkey Mobile App)

Thanks you

Johan
  • 74,508
  • 24
  • 191
  • 319
LIVESTUFF
  • 137
  • 4
  • 17
  • 1
    Are you really wanting to build your app targeting VCL on Windows, and FMX everywhere else? Because that's not how you are supposed to do it. If you want X-plat then you are mean to be FMX everywhere. – David Heffernan Nov 08 '13 at 21:42
  • Hi David, I have a component that will be used for both the Windows app and the Firemonkey mobile application, just some simple socket stuff - i used dialogs for me debugging (i know i shouldnt). Did you give me a negative. If so, why? Im need to learn why – LIVESTUFF Nov 08 '13 at 21:59
  • 1
    Just use `Dialogs` and use namespace prefixes to do the rest. – David Heffernan Nov 08 '13 at 22:01
  • I'm sorry, but this is getting a little frustrating. Please take a few minutes to [read the documentation](http://docwiki.embarcadero.com/RADStudio/XE5/en/Cross-Platform_Applications_Index). As @David said, there is clear information there about developing cross-platform applications. There is information about detecting what platform you're currently compiling for (`$IFDEF` values you can check for targets), and namespace prefixes (`VCL` vs. `FMX` and conditional `$DEFINE`s). – Ken White Nov 09 '13 at 01:33
  • 1
    Downvoted because the question is A: a repeat of many other questions asked before. B: all this stuff is very easily googleable. C: the question is unclear. D: you're asking more than one question in a single post. On top of that what you're trying to do is confused (not a reason to downvote BTW). You either use VCL and stick to Windows or use FMX and run everywhere. Mixing them is complicating your life. – Johan Nov 10 '13 at 10:00
  • 1
    Upvoted another of your questions to compensate. – Johan Nov 10 '13 at 10:07
  • 1
    @Johan, as I read the question his component is non-visual, and hence usable under both FMX and VCL, and he only wants to use Dialogs to show error/testing message. – Mike Sutton Nov 10 '13 at 14:16
  • @Johan, I disagree. It is what I want, and it is what I need. It is a component that will be shared amongst both projects and I know it can be done with the solution providd by Remy – LIVESTUFF Nov 11 '13 at 18:42

2 Answers2

5

There is documentation about this topic

Q : How do I determine the version of Delphi Xe5 ? Or, what is the version?

A: Check the System.CompilerVersion constant. For XE5, CompilerVersion is 26. or you can use the VER260 conditional.

Q: Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application.

A : Check the WIN32, WIN64 , ANDROID and IOS Predefined Conditionals.

Q : In code, how do I tell the compiler which version of Dialogs to use based on the type of my app. That is VCL.Dialogs (Windows App) versus FMX.Dialogs (Firemonkey Mobile App)

A: I Don't know what you mean.

Ken White
  • 123,280
  • 14
  • 225
  • 444
RRUZ
  • 134,889
  • 20
  • 356
  • 483
1

How do I determine the version of Delphi Xe5 ? Or, what is the version?

Use the CompilerVersion and RTLVersion constants. Refer to the documentation for more details.

Is there a way to determine between a Win 32 application,. Win 64 Application, and Firemonkey mobile Application

There is no way to differentiate between a VCL project and a FireMonkey project, and in fact it is possible (but not recommended) to mix VCL and FMX in the same project. As such, there is no project-specific conditionals defined by the compilers. However, what you should be doing instead is using IFDEF and IFNDEF statements in your code to target specific platforms, not specific project types. There are many platform-related conditionals defined by the various compilers: WIN32, WIN64, MACOS, IOS, ANDROID, just to name a few (there are many more). Refer to the documentation for more details.

If you absolutely must differentiate between a VCL project and a FireMonkey project, you will have to go into the Project Options and define your own custom conditionals for that purpose.

In code, how do I tell the compiler which version of Dialogs to use based on the type of my app. That is VCL.Dialogs (Windows App) versus FMX.Dialogs (Firemonkey Mobile App)

The best option is to specify only Dialogs by itself in your code, and then go into the Project Options and make sure that either Vcl or FMX is specified in the Unit Scope Names field. That will allow the compiler to choose between Vcl.Dialogs and FMX.Dialogs for you.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • For all you people who have down voted me, just so you know, I talked with Al Mannarino (lead systems engineer at Embarcadero Technologies) on Wend, 13th at the Meet & Greet at Ruth's Chris Steakhouse in Manhattan, New York, and I pitched this need of mine and he saw no problem with what I was doing , considering it was a non-visual component. I stand by my original statements. As a newbe on this site, I find it appalling at the speed of which people want to downvote and or close out threads so fast. I am already sour on this site – LIVESTUFF Nov 15 '13 at 21:20
  • You were downvoted because you did not follow the rules, did not read the documentation, did not do any research to find the answers to your questions that had already been asked many times before in many different forums and were easily searchable. As for Al, since you saw him face to face, you likely gave him more information than you provided here, so your question got closed for not providing enough details about what you really needed to accomplish. I don't know what Al actually told you, but I imagine it should have been similar to what I told you. – Remy Lebeau Nov 15 '13 at 21:53