Years ago I invested in PBCC2 then upgraded to PBCC3 and also invested in PBWin7 and PBForms. I later upgraded PBCC3 to PBCC4 (now PBCC4.04). Almost all my programming is in creating utility programs that run via batch scheduling jobs to convert data, communicate, etc. I didn't upgrade my PBWin7 to 8 because for the amount of work I did there, I didn't really need too. As I am now looking a FF for GUI work and reevaluating some of the projects I do, I still don't see the need to move to PBWin8.
For using SDK style windows programming, PBCC4 works fine. The only thing that is needed from the code FF generates is "#console off" before any statements. I could put that in the Win32API.ini, however I also use the win api for the CC apps. Since I'm looking at the same compiler, I can't use different copies of the win api ini. I also couldn't find any way to introduce code before the Win32api.ini include. When I do this in PBCC I simply put #console off as my first statement than I can do any SDK programming. I could use a declare for all my Console apps, but I have a lot of console apps.
Is there any way for me to introduce this as part of the generated FF code?
Also, just a FYI for anyone reading, you either have to modify the win32api.ini file to include the %CCWIN = 1 declare or put that declare in your code before you include the win32api.ini. So you can simply change the FF generated code main module to include the two lines before the #include "win32api.ini":
#console off
%CCWIN = 1
And it will compile and run the same as with the PBWin 8 program. (Unless I am missing the boat on something else)
Thanks,
Donnie
Hi Donnie,
I have never used PBCC with FireFly but given your requirements then you can accomplish it via a FireFly User Tool. Set up a Tool that will read the main FireFly generated code file and prepend the #Console Off directive to it.
Here is the code that you can use for the preprocessing of the main FireFly generated file:
#Compile Exe
Function PBMain() As Long
' Modify the main FireFly generated file. This is
' accomplished by setting up a FireFly User Tool
' and calling this program with the <S> parameter.
' preprocess.exe <S>
Local sFilename As String
Local st As String
Local f As Long
sFilename = "CODEGEN_" & Trim$(Command$)
If Dir$(sFilename) > "" Then
' Load all the main generated code
f = FreeFile
Open sFilename For Binary As #f
Get$ f, Lof(f), st
Close f
' Output the code with the new #console off parameter
st = "#Console Off" & $CrLf & st
f = FreeFile
Open sFilename For Binary As #f
Put$ f, st
Close f
End If
End Function
Save the above code as "preprocess.bas" and compile the exe and place it in the same directory as your FireFly.exe program.
Set up the FireFly User Tool to be invoked during "pre-compile" and for it to "Wait for Tool to complete before continuing". (refer to my attached screenshot).
BTW, this is just a hack that is needed in FireFly 2.... in FireFly 3 you will have full control over the main FireFly generated file so you can specify whatever directives you need.
[attachment deleted by admin]
Very cool. I get it.
Thanks for your help and solution,
Donnie