Confused need help :( 
Author Message
 Confused need help :(

Hi
This is hard for me to explain but I will try anyway.

I have created a button object labeled "button" and 2 list view controls in the view class. when I click on "button", message handler OnButtonClicked() calls a void function that updates the contents of the list view controls,  this works ok.

Problem is their is a case when I want to update the List view controls more than once without clicking "button" again the List view disappears instead of being updated.

OnButtonClicked()
{
   DisplayListControl();//contents updated correctly

Quote:
}

OnButtonClicked()
{
 do
 {
   DisplayListControl();//contents not updated on screen?
                        //ListControl text changes each time  
                        //after x times m_var = false
 }while(m_var == true);

Quote:
}

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.*-*-*.com/ ;  The website for Visual C++ programmers.


Mon, 09 Jul 2001 03:00:00 GMT  
 Confused need help :(
It would be a big help...if you would show us the code of
DisplayListControl() !

Christoph



Tue, 10 Jul 2001 03:00:00 GMT  
 Confused need help :(
Hi,

Comment inline



Quote:

>Hi
>This is hard for me to explain but I will try anyway.

>I have created a button object labeled "button" and 2 list view controls in the
> view class. when I click on "button", message handler OnButtonClicked() calls
> a void function that updates the contents of the list view controls,  this
> works ok.

>Problem is their is a case when I want to update the List view controls more
> than once without clicking "button" again the List view disappears instead of
> being updated.

>OnButtonClicked()
>{
>   DisplayListControl();//contents updated correctly
>}

>OnButtonClicked()
>{
> do
> {
>   DisplayListControl();//contents not updated on screen?
>                        //ListControl text changes each time  
>                        //after x times m_var = false

Try to add UpdateWindow or RedrawWindow here. DisplayListControl probably
invalidates ListView. When Windows has time it will check if any windows has
invalidated areas and send WM_PAINT for those windows. You however are running
in the loop so windows haven't time to send WM_PAINT.

This explains why ListView is not updated but instead of disappearing the
ListView should show contents of last DisplayListControl function. Therefore
I'm not sure if my answer is correct.

Quote:
> }while(m_var == true);
>}

>-----------------** -- Posted from CodeGuru -- **-----------------
>http://www.codeguru.com/    The website for Visual C++ programmers.

-------------------------------------------------------------
Mika Kurki - System Analyst, ICL Financial Services


to respond remove zzz from start of the address



Tue, 10 Jul 2001 03:00:00 GMT  
 Confused need help :(

UpdateWindow() was all it took, thanks!
The Last contents of DisplayListControl() was being shown(should have stated that.

Next problem though

While the loop is running I want the user to be able to click on a menu item and have the menu handler do its work and then have the program go back to OnPlayButton(). Is this possible?

Quote:

>Hi,

>Comment inline



>>Hi
>>This is hard for me to explain but I will try anyway.

>>I have created a button object labeled "button" and 2 list view controls in the
>> view class. when I click on "button", message handler OnButtonClicked() calls
>> a void function that updates the contents of the list view controls,  this
>> works ok.

>>Problem is their is a case when I want to update the List view controls more
>> than once without clicking "button" again the List view disappears instead of
>> being updated.

>>OnButtonClicked()
>>{
>>   DisplayListControl();//contents updated correctly
>>}

>>OnButtonClicked()
>>{
>> do
>> {
>>   DisplayListControl();//contents not updated on screen?
>>                        //ListControl text changes each time  
>>                        //after x times m_var = false

>Try to add UpdateWindow or RedrawWindow here. DisplayListControl probably
>invalidates ListView. When Windows has time it will check if any windows has
>invalidated areas and send WM_PAINT for those windows. You however are running
>in the loop so windows haven't time to send WM_PAINT.

>This explains why ListView is not updated but instead of disappearing the
>ListView should show contents of last DisplayListControl function. Therefore
>I'm not sure if my answer is correct.
>> }while(m_var == true);
>>}

>>-----------------** -- Posted from CodeGuru -- **-----------------
>>http://www.codeguru.com/    The website for Visual C++ programmers.

>-------------------------------------------------------------
>Mika Kurki - System Analyst, ICL Financial Services


>to respond remove zzz from start of the address

-----------------** -- Posted from CodeGuru -- **-----------------
http://www.codeguru.com/    The website for Visual C++ programmers.


Tue, 10 Jul 2001 03:00:00 GMT  
 Confused need help :(
That ought to be an error in your DisplayListControl function

Johan Rosengren
Responsable Informatique
PACTA S.A.



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Help needed for confusing problem

2. I have it kinda but I am really confused.PLease HElp

3. Very confusing ATL crash - any help appreciated!

4. HELP (Confused New User)!!!!!!!!!!!!

5. Confused on CView and CDoc - Please Help

6. HELP! confusing compiling ERROR

7. HELP: Confused with MFC CArray object!

8. Confused on CView and CDoc classes - Please Help

9. HELP , HELP , HELP - I need a compiler

10. A Problem confused me for years! Need your help!

11. Need some help! I'm confusing...

12. Help C newbie need help please

 

 
Powered by phpBB® Forum Software