PBMain

Started by rrioja, November 19, 2008, 05:12:59 PM

Previous topic - Next topic

rrioja

How do I access PBMain from FireFly?  I need to have a loop that works in the background all the time, outside of all dialogs.  Or is there another place where I can do that?

TechSupport

Try using "FF_WinMain", which you can access from the FireFly Workspace "Explorer" tab under the branch called "Special Functions". The FF_WinMain function is called before any dialogs are created.


rrioja

But that's the problem.  FF_WinMain is executed only once before the dialogs are created.  I want to run a loop that periodically performs a function in the background.  I have a program like that written in PB but I cannot convert it to FireFly.

TechSupport

Well then I am unclear about what you need to accomplish. In your PB program, where is your loop? If you can't put it in WinMain then where would you put it? Is it part of your main message loop (which implies that you have a dialog created?).

I thought that you were creating threads for your background processing and you wanted to have them start before any dialogs showed.

Just give me an idea of how your current app is structured and I'll see if I can suggest a way to make it "FireFly-able". Maybe you just need to hook into the message pump of the main form in your application (via the FF_PumpHook).


David Kenny

I agree with Paul, this sounds like a perfect situation for implementing a thread.

David

rrioja

My PB program uses the GRAPHIC WINDOW statement in PBMain to create a graphics window.  There are no dialogs.  Then, in a loop, I have a GRAPHIC INKEY$ statement to wait for input from the user, as well as a GRAPHIC WINDOW CLICK statement to see if the user clicked the mouse over certain areas of the graphic window.  I am using JPro with with Lynx.  What a terrific combination!!

I also purchased FireFly and have used it for one large project very successfully.  Now I tried to bring my PB graphic window program into FireFly but cannot make it work.  I tried to use FireFLy FF_WinMain with no success.

Thanks,
Robert

TechSupport

In this case you are probably better off sticking with the JPro/Lynx combination. FireFly expects to have at least one dialog active when it runs so trying to bypass that requirement and just use a Graphic window will cause problems. Also, mixing FireFly with DDT statements not always guaranteed to work (if at all).

:)


rrioja

Thanks for the advise.  I like your products and will continue to pay for them when they are not free.  Keep up the good work !!!

Robert

rrioja

I found a work-around.  In FireFly I set up a form and create the GRAPHIC WINDOW in the form's WM_CREATE function.  Then I placed a timer control on the form and put the GRAPHIC INKEY$ and GRAPHIC WINDOW CLICK commands in its function.  Instead of a loop, I use the timer.

I hope that the upcoming FireFly 3 has a way of adding code to PB_MAIN.

Robert