Link to home
Start Free TrialLog in
Avatar of saffron
saffron

asked on

Multi-tasking using forms

Ok, my problem is that my application has a function key which (should) go off to produce a report in the background.  This report isn't to be printed but,when ready, is displayed on a spreadsheet control.  In the meantime I would like the user to be able to carry on doing data-entry.

I've followed the coffee example in the VB documentation and also a couple of examples on this excellant website.  However they all seem to depend on use of the timer control.  When I ignore this and play around with the code to produce the report in the Active X exe my calling application still hangs whilst waiting for the exe to finish processing.

I can't set the ActiveX exe to run as unattended execution because it displays a form on completion of processing.  

What I would like is the processing to carry on in the background and an event raised to signal that the report is ready to be displayed.  How can I get this to happen?  

My ActiveX exe is set up as Multiuse and the projecties are set to 'thread per object'.  

Can anybody help?
ASKER CERTIFIED SOLUTION
Avatar of 4P
4P

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Surojitseal
Surojitseal

I may sound novice, but I had a similar problem. I wanted to load a listview control from a database table in the backbround while a form (displayed thru a activeX dll object) showed the infamous filecopy animation just like windows explorer. I fould that the window that should play the animation hanged up while the DO UNTIL EOF() loop executed. Just writing a DOEVENTS within that loop did the trick. Let me know whether you have a doevents in your code, and if so, then where.
Hello Surojitseal,

I have no DoEvents in my code. DoEvents is a working solution (though a little bit slow), but in my case the big thing was to give feedback to the caller form through an event.

Let's wait and see if Saffron will be interested in the code.

Avatar of saffron

ASKER

4P,

Thanks I'm going to accept your comment as the answer (sorry Surojitseal but DoEvents wasn't the solution).  Unfortunately I inadvertently posted this question twice and a suggestion similar to yours was given by mdougan so I'm going to have to split the points 2-ways.  Hope this doesn't seem unfair.

Basically you were right and the key was manipulating the enabled property of the timer in order to release control back to the client.

Thanks for your help.

Saffron.
Reviewing question.

darinw
Customer Service
Hi Saffron,

Thanks for accepting my comments.

My offer to on the code is still valid. If you are interested in it, or if you run into a problem with this later on, you can e-mail me at peter.papp@halliburton.com.

Our mail server is a bit slow right now because of ILoveYou, but I imagine this will be solved Monday.

Bye
Péter