• Welcome to PlanetSquires Forums.
 

FB FireFly 378 compile error when including AfxStr.inc from CWindow RC26

Started by David Warner, February 10, 2017, 05:52:51 PM

Previous topic - Next topic

David Warner

Hi Paul,

I just tried including the AfxStr.inc from Jose's CWindow Release Candidate 26 framework and FireFly FB 378 (todays build) generated a compile error because the AfxScaleX and AfxScaleY functions are defined in both AfxWin.inc and in the FireFly generated code CODEGEN_PROJECT1_MAIN.bas

To replicate this behaviour...

1) Create a new FireFly FB 378 Project.

2) Append the following line to the list of include files in FF_Appstart.

   #Include Once "Afx/AfxStr.inc"


3) Compile error generated by FireFly.

    (X) The Compiler returned an error during compiling:

        Error 4: Duplicated definition in 'Function AfxScaleX (BYVAL cx AS SINGLE) AS SINGLE'

        Additional compile information (including compile warnings can be found in the '_compilelog.txt' log file.

        [OK]


4) _project1_compilelog.txt

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:    CODEGEN_PROJECT1_MAIN.bas -o CODEGEN_PROJECT1_MAIN.asm (main module)
CODEGEN_PROJECT1_MAIN.bas(146) error 4: Duplicated definition in 'Function AfxScaleX (BYVAL cx AS SINGLE) AS SINGLE'
CODEGEN_PROJECT1_MAIN.bas(162) error 4: Duplicated definition in 'Function AfxScaleY (BYVAL cy AS SINGLE) AS SINGLE'

5) AfxScaleX and AfxScaleY functions are defined in both AfxWin.inc and CODEGEN_PROJECT1_MAIN.bas

Paul Squires

Thanks David, yes, a long time ago I stole Jose's afx scale code to implement into FireFly in order correctly handle DPI scaling. I will rename them in the code generation so as not to cause conflict. i rarely use FireFly these days other than to maintain my legacy programs (and to code FireFly itself of course). All my new stuff is using Jose's CWindow code. I hope to have a form designer built on top of WinFBE that will make placing controls, etc a little easier than having to do it all manually via code. I am also working on a very thin wrapper over Jose's classes that will emulate a lot of the dot syntax that we used to have in Visual Basic and that is present in most modern languages these days like .Net

Lots to do... it just requires time and motivation  :)
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

David Warner

Thanks Paul, I took the opportunity to exercise FB FireFly a little while checking out Jose's includes and as usual I immediately put my finger on something to report to you. I think I told you before that I’m quite good a breaking things. Sorry about that. :) Anyway thanks for the promised fix. I will look forward to testing the other new developments you described as and when you find the time etc.