Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label.Caption ignores code

Status
Not open for further replies.

acoust

Technical User
Oct 20, 2001
4
US
VB6 newbie, C oldie can't get this code to work. I want the Label2 caption to say "processing" while the big C dll is running (several minutes). The mouse pointer changes to an hourglass as expected, but the Label2 caption remains blank until the dll finishes, at which time it says "complete", as expected. The result is the same if the dll is replaced with a simple delay. (The dll and the rest of the VB6 program work fine.)

Private Sub Command1_Click()
Label2.Caption = "processing"
Form1.MousePointer = 11
Call BigCdll(xyz)
Form1.MousePointer = 0
Label2.Caption = "complete"
End Sub

 
Hi,

Try putting the

Label2.Caption = "processing"

instruction on the MOUSE_DOWN event.
When you click the mouse the event will run you code.

What seems to be happening is the first setting of
the caption in your code would be actioned when the end sub comes along. If you had fast enough eyes you'd probably
see the caption go from Processing to Completed very quicky.

Try this to prove it REM the last caption command line. I bet only after proceesing your DLL will the caption change to processing.

Any Help, Yes/No let me know

Regards

________________________________________
Is not a fool a wise man in his own eyes - Proverbs
 
Put a DoEvents() after the mousepointer change - that'll give the form time to refresh the caption. -Chris Didion
Matrix Automation, MCP
 
That last one looks good. You'll have this problem with other remote calls of different types as well, and VB won't update your displays. If you just get into the habit of refreshing the form before dividing VB's attention, you'll never have to worry about it again, and you're not opening the door to other, possibly unwanted, events at that time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top