- How to proceed?
- Switching to 64-bit mode
- Compilation error management mode
- Compilation errors specific to the 64-bit mode
- Various limits
- Registry and system files
Developing a 64-bit application
Recent computers (servers and desktop computers) are now equipped with "64-bit" operating systems.
The main difference between a "32-bit" and a "64-bit" system is as follows: in "64-bit", the applications and the system no longer have memory allocation limitations.
In "32-bit" configurations the operating system is limited to 4 GB, while in "64-bit", there is nearly no limit (the limit is set to 18 billions GB).
Operating mode of 32-bit applications:
- 32-bit WINDEV applications operate on a 64-bit operating system without modification: executable, setup, ...
- 32-bit applications run on a 64-bit system are indicated in the task manager. These applications are neither disrupted nor run in a compatibility mode: they are subject to the memory constraints of 32-bit applications. This limitation is not a constraint for most of the standard applications.
Switching to 64-bit mode
For an application that requires a lot of memory, to prepare for the future or to specifically use 64-bit DLLs, you have the ability to easily transform a "32-bit" WINDEV application into a "64-bit" WINDEV application.
To switch a WINDEV application from 32-bit to 64-bit:
- Open the 32-bit WINDEV project in the editor.
- Create a new project configuration: on the "Project" pane, in the "Project configuration" group, expand "New configuration" and select "Windows executable .. 64-bit".. The project configuration creation wizard starts.
- In the wizard:
- Specify the name of the project configuration. Choose an explicit name because this name will be used to create the generation directory of the files affected by the project configuration.
- Select the elements (windows, queries, ...) of this new configuration. In a standard case, all the elements of the 32-bit application must be selected.
- Validate the wizard.
- The project configuration is automatically created. If your development computer is in 64-bit mode, you have the ability to run the test of the 64-bit application via the 64-bit "GO" option.
- Creating a 64-bit application only: You have the ability to define that an application is a "64-bit" application when creating the project. However, this solution is more complicated because a "64-bit" application does not operate on a "32-bit" system bur only on a "64-bit" system.
- If you have created a project for a 64-bit application only, it is also possible to create a specific project configuration for 32-bit mode.
Compilation error management mode
- For the applications and services (Windows or Linux) in 32-bit mode, the 64-bit compilation errors are disabled.
- For the applications and services (Windows or Linux) in 64-bit mode, the 64-bit compilation errors are always enabled.
- For the components, libraries and Webservices, the 64-bit errors are always enabled.
Compilation errors specific to the 64-bit mode
If the "32-bit" application was using Windows APIs or external DLLs, the transformation to "64-bit" mode may generate compilation errors. These compilation errors are specific to the "64-bit" mode.
The most common error consists in using an "integer" variable to store a memory address.
On 64-bit machines, pointers take up 8 bytes of memory, whereas on 32-bit machines, they take up 4 bytes.
In this case, if a "standard" integer is used, the application may access a truncated memory address, therefore an invalid address.
To avoid this problem, you must use the Integer System
type of WLanguage: this type is uses an 8-byte integer in 64-bit and a 4-byte integer in 32-bit!
- Don't forget to check that the APIs used exist in "64-bit" mode. And make sure that the DLL does not have a different name in "64-bit" mode and that its operating mode is identical.
If differences are noticed, you have the ability to use In64bitMode to call the API corresponding to the current system.
- In 64-bit, if a value that is too large is assigned to a 1, 2, 4 or 8-byte Integer variable, the value of the variable will not be the same as in 32-bit.
- The wdxxxce.dll library for accessing a Mobile application does not work in 64-bit.
- Hasp is not available in 64-bit.
- NetXXX functions: Only the client part is available in 64-bit, and is compatible with a 32-bit server. The server part (NetStartServer and NetEndServer) is not available.
- 64-bit external languages: only C and C++ are available.
Registry and system files
- Registry: On a 64-bit system, the 32-bit applications write into the registry from the following branch: "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node".
- Access to the system files: On a 64-bit system, the 32-bit applications use different system directories.
For example, an access to the "\Windows\system32\" directory will be performed in this folder from a 64-bit executable.
On the contrary, from a 32-bit executable, the access will be performed in the "\Windows\SysWOW64" folder.
Click [Add] to post a comment