Text Update through CDialog and CFrame

I am running a program that requires a text update or 
maybe a progress bar of sort. My program is used to 
convert several files into one big file. Within the 
program it updates the Percentage of how much of the 
process is complete. I want to Show that Updated 
Percentage on CDialog and/or CFrame. And if this is 
possible also incorporate a progress bar. 

I have the text "update" through CFrame using CClientDC 
and having the program integrated into the CFrame Class I 
created. But the "update" is rather slow and when I 
resize the window or minumize and restore it the update 
and the text that was displayed disappears. And it 
reappears when the process is done. 
0
ecallasan (5)
8/6/2003 3:51:50 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
751 Views

Similar Articles

[PageSpeed] 24

>I have the text "update" through CFrame using CClientDC 
>and having the program integrated into the CFrame Class I 
>created. But the "update" is rather slow and when I 
>resize the window or minumize and restore it the update 
>and the text that was displayed disappears. And it 
>reappears when the process is done. 

Edmond,

It sounds as though you're only updating the UI at certain times and
your file operations are being done in the same thread. If you want to
maintain a responsive UI you could redesign your application by
putting the lengthy file operations in a separate worker thread and
have that communicate the progress to your UI thread by posting
messages to the window. That's what I've done in a similar situation
anyway!

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
8/6/2003 4:44:31 PM
>-----Original Message-----
>>I have the text "update" through CFrame using CClientDC 
>>and having the program integrated into the CFrame Class 
I 
>>created. But the "update" is rather slow and when I 
>>resize the window or minumize and restore it the update 
>>and the text that was displayed disappears. And it 
>>reappears when the process is done. 
>
>Edmond,
>
>It sounds as though you're only updating the UI at 
certain times and
>your file operations are being done in the same thread. 
If you want to
>maintain a responsive UI you could redesign your 
application by
>putting the lengthy file operations in a separate worker 
thread and
>have that communicate the progress to your UI thread by 
posting
>messages to the window. That's what I've done in a 
similar situation
>anyway!
>
>Dave
>--
>MVP VC++ FAQ: http://www.mvps.org/vcfaq
>.
>
Thanks Dave for the advice. I am not too familiar with 
creating threads. Maybe you can give me a similar example 
as to how I can start that?
0
ecallasan (5)
8/6/2003 6:10:36 PM
>-----Original Message-----
>>I have the text "update" through CFrame using CClientDC 
>>and having the program integrated into the CFrame Class 
I 
>>created. But the "update" is rather slow and when I 
>>resize the window or minumize and restore it the update 
>>and the text that was displayed disappears. And it 
>>reappears when the process is done. 
>
>Edmond,
>
>It sounds as though you're only updating the UI at 
certain times and
>your file operations are being done in the same thread. 
If you want to
>maintain a responsive UI you could redesign your 
application by
>putting the lengthy file operations in a separate worker 
thread and
>have that communicate the progress to your UI thread by 
posting
>messages to the window. That's what I've done in a 
similar situation
>anyway!
>
>Dave
>--
>MVP VC++ FAQ: http://www.mvps.org/vcfaq
>.
>
Thanks Dave for the advice. I am not too familiar with 
creating threads. Maybe you can give me a similar example 
as to how I can start that?
0
ecallasan (5)
8/6/2003 6:10:39 PM
>Thanks Dave for the advice. I am not too familiar with 
>creating threads. Maybe you can give me a similar example 
>as to how I can start that?

Have a look at "Multithreading: Creating Worker Threads" in the MSDN
documentation.

You will undoubtedly need to do some restructuring of your existing
code to get it into a separate thread. The main thing to remember is
to eliminate all UI aspects from the thread and defer them to the UI
thread (usually by posting a user defined message ).

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl (422)
8/6/2003 9:52:24 PM
Reply:

Similar Artilces:

Update pass through query of report recordsource
I am working on upsizing my access backend database to SQL Server. I have linked all sql tables to the frontend and am now running into the issue of slow performance on one of the reports. One way to improve that I thought was to change the recordsource query (which is a saved query) to a pass through query. However there are form controls that drive the parameters. So I was wondering if a better way to do this is to create the sql query string in vba and then set the report record source. Is this a viable option? Is there a better way? Please ask any leading questions i...

Access2000: Update query
Hi I have a table p.e. MyTable with columns ID, F01, F02, ..., F12 I also have a view/query p.e. MyQuery, also with columns ID, F01, F02, ..., F12, where MyQuery.ID is read from MyTable (i.e. both table and query have same set of ID-values), and rest of fields are calculated based on data from other tables in database. Now I need to update MyTable with values for columns F01 - F12 from MyQuery for all ID's. Somehow I don't get it working. What will be right syntax? Thanks in advance! Arvi Laanemets Normally, you use something like UPDATE MyTable INNER ...

parsing and importing a text file with records through a VBA macro
Hi all, I'm really stuck in a problem in parsing and importing a text file into an Excel sheet with a VBA macro. I strongly need to do it by a VBA macro in order to postprocess the resulting data through Excel. I searched a lot into the network and I found something useful but I can't achieve the final solution actually. Can you help me please? Your help is really appreciated. My text file is containing several records formatted like this: REC1_FIELD1 REC1_FIELD2 REC1_FIELD3 REC1_FIELD4 REC1_FIELD5 REC1_FIELD6 REC2_FIELD1 REC2_FIELD2 REC2_FIELD3 REC2_FIELD4 R...

Outlook 2003 Update Fails
Using automatic update I have downloaded and tried to install an update listed as Outlook 2003 Junk Mail Filter (KB925254), but every time I get a message that the update failed. I tried to go to the Microsoft website to find out about this but do not know where to go or who to tell. Help, Frank Apparently this was in my outbox and I did not realize it. Please disregard to see my related message. "flyer" <franklin.breeden@verizon.net> wrote in message news:WdSih.5$Ej7.3@trnddc02... > Using automatic update I have downloaded and tried to install an update > lis...

Calculations based on 4 possible text strings?
I have this formula that goes into E2 in the first line: =IF(C2<>"",IF(D2="PST+GST",SUMPRODUCT(C2*0.13),"")) which works if the text string PST+GST is found in D2. But I don't know how to branch out from there. There are 4 possible answers to go into D2 which will affect outcome of E2. They are, and I'll list them all including the PST+GST case above: if D2 = text string "PST+GST", E2 = SUMPRODUCT(C2*0.13) if D2 = text string "PST", E2 = SUMPRODUCT(C2*0.06) if D2 = text string "GST", E2 = SUMPRODUCT(C2*0.06) [c...

Why doesn't my original message text show in the reply message?
When I send out e-mails, sometimes the reply back to me does not include my original text. Why? I know they are just hitting the reply button because the Re line has "exactly" what I originally typed. This has happened on several occasions. There is an option in Outlook and Outlook Express to include the original message in a reply. If they have that option disabled, then when they reply to you, the original message will be removed from the email. In order to enable or disable this option in Outlook 2003 (I believe 2007 and Outlook Express are similar) please do...

CDialogBar on a CDialog
Hi, I understand that CDialogBar was originally designed to work with CFrameWnd. However, I have a dialog based application and I need to put 2 CDialogBars on my CDialog. I have achieved to do this in the following manner: My main dialog class (on which I need to put the dialog bars) is called CMainDlg which is derived from CDialog. I have two dialog bars, CFirstDialogBar and CSecondDialogBar, both derived from CDialogBar. I first created a CFrameWnd on the CMainDlg and then attached a view to this frame window. int CMainDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CDialog::O...

Text style reverts on save
I am using Publisher 2003 SP2. I have a document that has a few text styles I have defined. When I modify a style the document appearsw properly, but when I save the file, close Publisher, and re-open Publisher the changes are lost. If I delete the misbehaving style and re-create it all is well, except that the change to another style vanishes. help! ...

Security Update for Windows Server 2003 (KB956744) Cannot Install.
For Windows Server 2003. This is a standard Windows Update that I try to install but get a message that it failed to install. I can't find any source to tell me why it won't or what I can do about it. I am not getting an error code of any sort - it is just listed under "not installed" when I get my update installation screen at the end of the installs. Can anyone help please? I downloaded the update manually from: http://www.microsoft.com/downloads/details.aspx?familyid=a37a2d8a-a5ce-4f06-bf07-8cafa16e7a59&displaylang=en Ran it, and then ran Check U...

KB982524-.Net update
WIN XP PRO SP3 I have just dll, burnt to disc and installed this update. All went well - the yellow shield has gone from system tray, but on checking Add/Remove, the KB installed is 976576?? Is this correct? Rgds Antioch On 2010-06-25 8:43 a.m., antioch wrote: > WIN XP PRO SP3 > > I have just dll, burnt to disc and installed this update. > All went well - the yellow shield has gone from system tray, but on > checking Add/Remove, the KB installed is 976576?? > > Is this correct? KB982524 says that 982524 is an update rollup, and references 9765...

Color changing text for blue to red
I want to take a part of a form I am making and have the title line only go from blue on the left side to red on the right side. I tried word art but did not get the desired results. I want each letter to be a different soled color from the one beside it. If there is no automatic way of doing this then what is the easiest way of doing it manually I an using Pub XP on a W2K box. If it is in word art then I missed and would like to know for future reference. Highlight one letter at a time and change each one manually. -- JoAnn Paules MVP Microsoft [Publisher] "Brady" <sp...

How do I get text effects in excel like those available in word
In MS Word you can get text effects under "Format" "Font" I want to do the same in excel - any suggestions please? I would also like to conditionally format an excel formulae to give an "effect" if it did not meet a given criteria - Conditional formatting does not provided "Text Effects" Thanks It does. Condiitional formatting providet COLOR effects. Conditional Formatting > click Format Button > select Color for formatting. -- Manatee ------------------------------------------------------------------------ Manatee's Profile: http://www....

Get text from anather application
want to get to copy or get the selected text from internet explorer i use this code to get the hWnd HWND FgHwnd=GetForegroundWindow(); DWORD lpdwProcessId; DWORD td=GetWindowThreadProcessId(FgHwnd,&lpdwProcessId); AttachThreadInput(td,GetCurrentThreadId(),TRUE); HWND awnd=GetFocus(); and then i use SendMessage to copy the text char buffer[256] = {0}; SendMessage(awnd, WM_COPY,255, (LPARAM)&buffer); its works fine if the application has a simple edit or rich edit box. but i when i want to get the text from internet explorer it doesnt work. Please help me natanr123@vfem...

Solution for: Windows XP (NL): Windows Activation Problem + Windows Automatic Update Problem = Very Slow Computer.
I think I have found a solution on the internet, I will sum it up shortly because the description wasn't that accurate, my description will be more accurate with additional information about what I think might have happened, but first a little story what I wanted to do today: Today I wanted to try and install Service Pack 3 for Windows XP dutch version (NL). This was not possible because Windows Automatic Updates was required by the Microsoft website to be able to download it and windows automatic updates is malfunctioning, so that became a short attempt. Then I decided to ...

Splitting Text from single cell in column across multiple Columns
Text To column wont work because I have name and address info in a single cell in this format. Each cell has different data representing different addresses. Name St # St Name Phone Number City, State zip I want a formula or something to take first line and put in one column, the 2nd line in another column and the 3rd line spread across 3 columns. Although if you could just find a way to split each line into a column, that would work. Once again, Text to colun won't work, I have multiple cells with diffeent addresses, they are not all the same and there are no deli...

Duplicating text in Word 2007
Hi, I've got a template I previously did for Word 2003 where I basically had several {macrobutton nomacro Type something here} fields. Now, in Word 2007, I see I have the option to actually add a Text content control, which looks fantastic :) BUT, is there a way of making it so that if I type something in one content control, the same text value is automatically added into the second one as well? Or even a third? How can I do that? Found out that if I insert a comment field and copy that field, they both work as I want! Yay! But, the comment field I insert via the Insert...

How can I update endnote cross-references in Word 2007 ?
I created a long document with many endnotes and some cross-references to these endnotes. When I insert a new endnote somewhere in the document, the following endnote numbers change but not the cross-reference numbers. This seems to be a bug in Word 2007 as it worked perfectly in my previous Word version. How can I update endnote cross-references in Word 2007 ? Ctrl+A, F9 should work in all versions of Word. -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA http://word.mvps.org "Joe56" <Joe56@discussions.microsoft.com> wro...

Comparing two columns of text data
I'm working with copies of someone else's SAP files. Machine operators enter "Notifications" into SAP, which schedulers turn into "Work Orders". After the job is complete, there is a row of data for each time anyone - operator, scheduler, mechanic, etc. - made a change to the record. Notifications have distinct numbers, as do work orders. So you may have: NOTIFICATION | WORK ORDER | ACTIVITY 0001 | 2985 | Notified pump out 0001 | 2985 | Scheduled work 0001 | 2985 | Calibrated pump 0001 | 2985 | Caliper post on first grid armature adjusted to thr...

update /delete external refs
I have written a macro and want to se it on older workbooks.This requires that a new page replaces an existing page.However all the references come over with the new page.I want to use edit/find replace all to replace [JUL02]Frame!C$6 with Frame!C$6 ie delete all references to original worksheet.(or some other way!) I have figured it out!.I copy the new page over to the old worksheet and then change source of links back to itself! >-----Original Message----- >I have written a macro and want to se it on older >workbooks.This requires that a new page replaces an >existing pa...

Cannot insert pictures in Pubisher. Text also disappears!
I have worked for several hours on a newsletter, now everything changes. Photos overlay on print and print disappears. Read the third FAQ here http://ed.mvps.org/Static.aspx?=Publisher/FAQs -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "Disgusted" <Disgusted@discussions.microsoft.com> wrote in message news:421A5715-4D0A-4EC9-8C94-941B4B9DBA9F@microsoft.com... >I have worked for several hours on a newsletter, now everything changes. > Photos over...

Language changes after update query
I have a data entry form where the user fills out text, numerical data, dates, etc. I created a button in the same form that runs a macro in background containing several update queries. At least 1 record changes from English to some other kind of language or font but it looks like Japanese or Chinese characters. I can't figure out why this happens and only on the that 1 macro. I would very much appreciate your input. TIA On Wed, 5 Mar 2008 10:10:01 -0800, Y2 <Y2@discussions.microsoft.com> wrote: >I have a data entry form where the user fills out text, numerical data, ...

Excel 2007
In Excel 2002 I built a simple line chart with 3 series, date bottom axis - the source date table was a huge worksheet of 1000 lines and 30 columns, but and my chart used 3 contiguous columns plus a non-contiguous date column. To update the chart daily, i simply added the new line to the worksheet, extended my selection box to cover that line and the chart was done. I had set up legend titles that were not the same as the related column titles. Now that I have converted to Excel 2007, none of this works - when I try to update the series data, the chart melts into one line and I lose ...

Saving Outlook Email As Text File Extract
Hello Outlook Group: I'm normally an Access and Excel VBA programmer, but my client wants me to scrape the text from a select email address and insert it into an Access memo column. Does anyone know how to configure Outlook (VBA approach would be fine) so that when an email is received in a selected account, the message would also be extracted to a directory as a text file and then the Outlook message would be moved to some history folder. Once the text file exists in a predefined folder , I will just have Access periodically check the folder for files, grab the text, ...

Getting form expression results to update to table.
The totals from the expressions in a couple fields on the form don't update to the table. They (the expressions) work correctly in the form, but they (the results of the expressions) don't appear on the table after clicking Update All. Does anyone know how ot fix this? Hi Peg, First, forms don't contain fields. They contain controls (most commonly textboxes) which may or may not be bound to fields in the form's recordsource. If they are bound to a field, changing the data in the form will change the underlying field in a table (unless the form's recordsource ha...

Inserting text from scanner
When I try to insert a text document from my scanner a message says it cant be done as I dont have the proper graphic converter. Is there something I can download for this? I'm using office 2003. All replies appreciated thanks. Kanneily Have you tried using your OCR software to get the text into Word first? That's what I do and it works just fine. JoAnn Paules MVP Publisher "Kanneily" wrote: > When I try to insert a text document from my scanner a message says it cant > be done as I dont have the proper graphic converter. Is there something I can > downlo...