Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Jul 12, 2020 1:36 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Using thread
PostPosted: Tue Jul 17, 2012 7:23 am 

Joined: Tue Jun 07, 2011 5:35 pm
Posts: 21
I have a Windows application that converts Microsoft works files from(wks to rtf). The routine is working but the GUI of course becomes non responsive while files are being converted. Wanted to provide progress info in the main window, I decided to put the main converter method inside a thread.

Below is code in the Thread

Dim wapp as WordApplication
Dim wdoc as WordDocument
Dim param_fname as variant
Dim param_saveas as variant
Dim param_confirmConversion as Variant
Dim f as FolderItem
Dim new_name as string
Dim f_extension as string
Dim numof_files as integer

If win_main.cbox_type.ListIndex=0 then
End If

wapp=new WordApplication
', confirmConversion)]

For i as integer = 0 to win_main.lbox_files.ListCount -1

numof_files=numof_files + 1
new_name=replace( win_main.lbox_files.list(i) ,".wps",f_extension),false)


numof_files=numof_files + 1 is a property of win_main. I have set a timer in win_main to update the label on win_main.

The code (below) that changes the label [timer is supposed to update label] only runs after all files have been converted and of course the window is still unresponsive.
lbl_status.Text=str(int_list_item) + " files converted"

Any suggestions as to how I might possibly get the update code in win_main to update as each file is being processed.

Thanks in advance.

Using RealBasic Professional Edition 2011 Release 2

Reply with quote  
 Post subject: Re: Using thread
PostPosted: Tue Jul 17, 2012 9:23 pm 

Joined: Wed Feb 16, 2011 1:59 pm
Posts: 74
Location: Arizona, USA
I think you're following something similar to the following: ... right.html
But have a read just in case.

int_list_item is a property of the win_main?

Windows XP SP3
RS 2012r2

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group