José, if you're bored...

Started by Paul Squires, August 02, 2018, 09:49:19 PM

Previous topic - Next topic

José Roca

This code posted by Pierre Bellisle seems to be a better solution that calling IsWow64Process:


#include "Windows.bi"
Dim SysInfo AS SYSTEM_INFO
GetNativeSystemInfo(@SysInfo) 'Available since Windows XP.
MessageBox(HWND_DESKTOP, "Windows is " & _
           IIf(SysInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64, "64", "32") & _
           " bit", "System info", MB_OK OR MB_TOPMOST)

Marc Pons

José and Pierre thank's

The Pierre's solution is much more elegant, but i think it can be little bit completed to insure all 64 bits processor possibilities

#include "Windows.bi"
Dim SysInfo AS SYSTEM_INFO
GetNativeSystemInfo(@SysInfo) 'Available since Windows XP.
MessageBox(HWND_DESKTOP, "Windows is " & _
           IIf(SysInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_AMD64 _
   or  SysInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64 , _
   "64" , "32") & " bits", "System info", MB_OK OR MB_TOPMOST)

'Constants for GetSystemInfo and GetNativeSystemInfo API functions (SYSTEM_INFO structure)
'PROCESSOR_ARCHITECTURE_AMD64  = 9 'x64 (AMD or Intel)
'PROCESSOR_ARCHITECTURE_IA64  = 6 'Intel Itanium Processor Family (IPF)
'PROCESSOR_ARCHITECTURE_INTEL  = 0 'x86
'PROCESSOR_ARCHITECTURE_UNKNOWN  = &HFFFF& 'Unknown architecture

José Roca

#122
Windows no longer supports Itanium. The last version that did it was Windows Server 2008.

Joerg B.

#123
Hi José
I have downloaded and installed the current 32-bit and 64-bit compiler versions of FreeBasic.
Now I get error messages when compiling.
I put the screenshots on you.

However, the source code is still compiled into an executable file.
Greeting from Germany

Joerg

José Roca

#124
There is not any error in the code. Apparently they have broken the compiler.

I have posted a message in the FB forum:
https://www.freebasic.net/forum/viewtopic.php?f=3&t=26976

Joerg B.

Hi José
Thanks for taking care of this.
Greeting from Germany

Joerg

Pierre Bellisle

> ...insure all 64 bits processor possibilities.

Hi Marc,
To add at José's comment, FB does not provide any compiler for the Itanium IA-64 instruction set.
So this FB code won't work on those platform.

It is either,
PROCESSOR_ARCHITECTURE_INTEL - Intel 80386 - i386 - 386 - x86 wich have a 32-bit instruction set.
or
PROCESSOR_ARCHITECTURE_AMD64 - AMD64 - x86-64 - x64 - Intel 64 wich is the 64-bit version of the x86 instruction set.

Marc Pons

Pierre and José : Thank's for your informations.

José Roca

I have modified AfxWin.inc and CWindow.inc to comply with the stricter casting rules of the latest compilers (don't know yet if I have to do changes to other files) and avoid the warnings.

Joerg B.

Hey José
It looks like other files are affected by the change.
I replaced AfxWin.inc and CWindows.inc and tested them with the old and the new compiler.
The results can be seen in the attached screenshots.
Greeting from Germany

Joerg

Joerg B.

Hey José
Your work worked fine before. Then the problem is actually the changes to the new compiler.

If you adjust your files according to the errors, the error messages will come back at the latest when the errors are fixed.

I'm back to the "old" version of AfxWin and CWindows and the compiler from WinFBE Suite now.
Greeting from Germany

Joerg

José Roca

#131
> I'm back to the "old" version of AfxWin and CWindows and the compiler from WinFBE Suite now.

Are you going to use the old compiler and the old include files for ever? The new behavior is not because of a bug in the new compilers, but because of stricter type checking, and this isn't going to change.

The errors that you're getting now are all related with WinFormsX and the fix is easy:

Paul must change


Cast(WNDPROC, @wfxApplication.SubclassProc)


to


Cast(SUBCLASSPROC, @wfxApplication.SubclassProc)


José Roca

Better to fix the problems sooner than later. Paul and I use the latest builds of the compilers to avoid bad surprises later, when they will be released. This time you have gone ahead us by installing them before I even had noticed its existence.

Joerg B.

#133
Hola Josè.

No. If possible, I always prefer to work with the latest versions.
This is the only way I can benefit from additions and/or bug fixes if required.
In this case I went back because I'm not sure if the error messages will have an effect on my program......
As soon as I see the green light here, I will install the latest versions again.

I read the posts in the FB Forum earlier.

When I see or read what discussion your post in the FB forum caused, then the experimental installation was probably not wrong.   :)
Greeting from Germany

Joerg

José Roca

Don't be afraid. It is not a show stopper, but an small change almost cosmetic.