PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Problems with Windows 10  (Read 669 times)

José Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3087
    • Jos
Problems with Windows 10
« on: April 26, 2018, 08:54:58 AM »

I have bought a new HP computer with Intel i5-7500 3,4 GHz and I'm having problems trying to use FreeBasic with it.

Just using

#include once "windows.bi"

generates the following output (using -v -showincludes to display the tree of included files):

Code: [Select]
FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target:       win32, 486, 32bit
compiling:    C:\Programación\Tests\x.bas -o C:\Programación\Tests\x.asm (main module)
x.bas
 |  C:\Programación\FreeBasic32\inc\windows.bi
 |   |  C:\Programación\FreeBasic32\inc\crt\stdarg.bi
 |   |  C:\Programación\FreeBasic32\inc\win\windef.bi
 |   |   |  C:\Programación\FreeBasic32\inc\win\_mingw.bi
 |   |   |  C:\Programación\FreeBasic32\inc\win\winapifamily.bi
 |   |   |  C:\Programación\FreeBasic32\inc\win\basetsd.bi
 |   |   |   |  C:\Programación\FreeBasic32\inc\win\_mingw.bi
C:\Programación\FreeBasic32\inc\win\_mingw.bi(23) error 4: Duplicated definition, __STRINGIFY in '#define __STRINGIFY(x) #x'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(24) error 4: Duplicated definition, __MINGW64_STRINGIFY in '#define __MINGW64_STRINGIFY(x) __STRINGIFY(x)'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(38) error 4: Duplicated definition, __MINGW_IMP_SYMBOL in '#define __MINGW_IMP_SYMBOL(sym) _imp__##sym'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(39) error 4: Duplicated definition, __MINGW_IMP_LSYMBOL in '#define __MINGW_IMP_LSYMBOL(sym) __imp__##sym'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(41) error 4: Duplicated definition, __MINGW_USYMBOL in '#define __MINGW_LSYMBOL(sym) sym'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(46) error 4: Duplicated definition, __MSABI_LONG in '#define __MSABI_LONG(x) x##l'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(78) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_MEMORY in '#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(79) error 4: Duplicated definition, _CRT_INSECURE_DEPRECATE_GLOBALS in '#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(81) error 4: Duplicated definition, _CRT_OBSOLETE in '#define _CRT_OBSOLETE(_NewItem)'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(87) error 4: Duplicated definition in 'declare function __mingw_get_crt_info() as const zstring ptr'
C:\Programación\FreeBasic32\inc\win\_mingw.bi(87) error 132: Too many errors, exiting

Looks like the #pragma once and #include once directives are being ignored and the compiler tries to parse _mingw.bi twice.

Regardin WinFBE and other executables of some of my examples, they don't scale according the DPI setting and run at 96 DPI.

PowerBasic runs fine.
« Last Edit: April 26, 2018, 09:35:16 AM by José Roca »
Logged

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8553
  • Windows 10
    • PlanetSquires Software
Re: Problems with Windows 10
« Reply #1 on: April 26, 2018, 09:07:48 AM »

Hi José, what you describe seems super strange. I have been using Windows 10 since it was released. Never had any problems with it. It runs even better than Windows 7. I haven't noticed any scaling issues either. FireFly looks ugly on my new system but WinFBE looks perfect. Here are my specs:

Dell XPS, 16 gig RAM, i7-7700HQ @ 2.80GHz (64-bit Win10)

I am running a 3840 x 2160 screen at 350% scaling.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

José Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3087
    • Jos
Re: Problems with Windows 10
« Reply #2 on: April 26, 2018, 10:00:33 AM »

And the biggest problem is that I can't investigate because I can't compile.

> I am running a 3840 x 2160 screen at 350% scaling.

Now you know why I have been so insistent about the importance of writing DPI aware applications. When running virtualized at such scaling, controls like check boxes a radio buttons look particullary horrible.

Johan Klassen

  • FireFly3 Registered User
  • Junior Member
  • *
  • Posts: 70
  • FF3 User
Re: Problems with Windows 10
« Reply #3 on: April 26, 2018, 10:47:48 AM »

is C:\Programación equivalent to C:\Program Files? if so it could be a permissions problem
Logged

José Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3087
    • Jos
Re: Problems with Windows 10
« Reply #4 on: April 26, 2018, 11:28:46 AM »

No, it happens that apparently FreeBasic does not like Spanish accents. After renaming the folder to "Programs", it works fine.

Now I have to investigate why it does not scale.

José Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3087
    • Jos
Re: Problems with Windows 10
« Reply #5 on: April 26, 2018, 02:13:38 PM »

To solve the second problem, I have changed this line in CWindow.inc

Code: [Select]
IF AfxUseDpiScaling = 0 THEN this.DPI = 96 ELSE this.DPI = -1

to

Code: [Select]
IF AfxIsProcessDpiAware = FALSE THEN this.DPI = 96 ELSE this.DPI = -1

AfxUseDpiScaling queries the registry entry "Software\Microsoft\Windows\DWM" for the value of "UseDpiScaling", but this value is not present in my registry. I think that I used it in the times of Windows XP, where you could use large font but did not support the IsProcessAware function. Workarounds sometimes end biting you.

I have noticed that with Windows 10 you can change the DPI on the fly and Windows resizes the window and controls Cool!

@Paul,

I'm attaching the modified CWindow.inc file to allow you to test if it work with your editor.

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8553
  • Windows 10
    • PlanetSquires Software
Re: Problems with Windows 10
« Reply #6 on: April 26, 2018, 04:38:47 PM »


@Paul,

I'm attaching the modified CWindow.inc file to allow you to test if it work with your editor.


Thanks! I have tried it wil both a 32 and 64 recompile of the editor and both seem to work okay. I haven't noticed any problems but if I do I will be sure to let you know.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8553
  • Windows 10
    • PlanetSquires Software
Re: Problems with Windows 10
« Reply #7 on: April 26, 2018, 04:42:46 PM »

AfxUseDpiScaling queries the registry entry "Software\Microsoft\Windows\DWM" for the value of "UseDpiScaling", but this value is not present in my registry. I think that I used it in the times of Windows XP, where you could use large font but did not support the IsProcessAware function. Workarounds sometimes end biting you.
On my system, that Registry entry existed and was set to true so of course I never noticed any issues. Thanks for fixing the issue so that it will now work on all modern versions of Windows.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

José Roca

  • FireFly3 Registered User
  • Master Member
  • *
  • Posts: 3087
    • Jos
Re: Problems with Windows 10
« Reply #8 on: April 26, 2018, 05:15:19 PM »

Great. I have recompiled your editor and I can work with FreeBasic again.