PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Robert Debolt on September 14, 2011, 12:09:51 AM

Title: Firefly with PB 10 #2
Post by: Robert Debolt on September 14, 2011, 12:09:51 AM

I'm returning to PB after years away and just got PB 10.
I have Firefly 3.10, PBwin 10.02 and win7.

When I attempt to compile the Address example I get an error.
Error 420.
Function Ff_Pumphook( Msg As tagMsg ) As Long

   ' If this function returns FALSE (zero) then the processing of the regular
   ' FireFly message pump will continue. Returning TRUE (non-zero) will bypass
   ' the regular message pump.
   Function = %FALSE    'return %TRUE if you need to bypass the FireFly message pump
   ' If you are dealing with a 'normal' OCX control then the following code will
   ' allow the message to be forwarded to the OCX.
   #If %Def( %USE_JOSE_INCLUDES )
      #If %Def( %USE_JOSE_OCX )
         Function = OC_ForwardMessage( Getfocus(), Msg)
      #Endif
   #Endif
End Function


I applied all documented changes to the include file.
I have tried both sets of includes (Jose and PB).
Please advise.

Regards,
Bob
Title: Re: Firefly with PB 10 #2
Post by: James Padgett on September 14, 2011, 07:43:27 AM
Open the Project Properties Menu Item and ensure you have selected Jose Roca Include files  ..

Title: Re: Firefly with PB 10 #2
Post by: Paul Squires on September 14, 2011, 08:22:19 AM
Also try opening the code generated file CODEGEN_*_MAIN.BAS and compile that using JPro or PBEdit, etc. That may also help pinpoint a specific compile time error position.
Title: Re: Firefly with PB 10 #2
Post by: José Roca on September 14, 2011, 10:59:39 AM
It compiles fine using my headers.

When using the new headers provided with the PB 10 compiler, you will get error 420 in the following line:


MapWindowPoints %HWND_DESKTOP, GetParent(hWnd), @ff.rcCtrl, 2


that belongs to the following function:


Function FLY_ResizeRuleInitEnum( ByVal hWnd As Long, ByVal lParam As Long ) As Long

   Local ff As FLY_DATA Ptr

   ff = GetProp(hWnd, "FLY_PTR")
   If ff = 0 Then Function = %TRUE: Exit Function

   If @ff.fResizeInit = %TRUE Then Function = %TRUE: Exit Function

   ' Store form width and height for future reference
   GetClientRect GetParent(hWnd), @ff.rcForm

   ' Get the control's rectangle and convert it to client coordinates
   GetWindowRect hWnd, @ff.rcCtrl
   MapWindowPoints %HWND_DESKTOP, GetParent(hWnd), @ff.rcCtrl, 2

   @ff.fResizeInit = %TRUE

   Function = %TRUE

End Function


It is caused by MapWindowPoints having being declared as:


DECLARE FUNCTION MapWindowPoints LIB "User32.dll" ALIAS "MapWindowPoints" _
    (BYVAL hWndFrom AS DWORD, BYVAL hWndTo AS DWORD, BYVAL lppt AS POINT PTR, _
    BYVAL cPoints AS DWORD) AS LONG


when previously was declared as:


DECLARE FUNCTION MapWindowPoints LIB "USER32.DLL" ALIAS "MapWindowPoints" (BYVAL hWndFrom AS DWORD, BYVAL hWndTo AS DWORD, lppt AS ANY, BYVAL cPoints AS LONG) AS LONG


The lppt parameter has been changed to BYVAL POINT PTR for no good reason.
Title: Re: Firefly with PB 10 #2
Post by: Robert Debolt on September 14, 2011, 09:27:00 PM
Quote from: James Padgett on September 14, 2011, 07:43:27 AM
Open the Project Properties Menu Item and ensure you have selected Jose Roca Include files  ..
Yes.  I re-downloaded the files from WINAPI_II_04.rar.  See powerbasic.png.

Quote from: TechSupport on September 14, 2011, 08:22:19 AM
Also try opening the code generated file CODEGEN_*_MAIN.BAS and compile that using JPro or PBEdit, etc. That may also help pinpoint a specific compile time error position.
Yes, it is as Jose has said.

Examining the C:\Program Files (x86)\FireFly Visual Designer\Projects\Examples\Address\release\CODEGEN_ADDRESS_MAIN.bas shows the folowing comment:

' FireFly will automatically replace the JOSEINCLUDES token based on the controls that are present
' in the project. If Jose Roca's includes are not specified in 'Environment Options' for the compiler
' then FireFly will simply use the default PowerBASIC Win32 API Include files that ship with the compiler.
#If Not %Def( %USE_JOSE_INCLUDES )
#Include "WIN32API.INC"
#Include "COMMCTRL.INC"  ' needed for WinXP Theme support
'#INCLUDE "COMDLG32.INC"
'#INCLUDE "RICHEDIT.INC"
#EndIf                                               


So apparently there is something wrong in how I set up the environment.  See images below.

Many thanks for your help.
Bob