Re: How toUpdateData() for a single edit box, not the entire dialog??



Hey fish (flounder),

My hard drive crashed, I lost all my stuff. Lost job, Lost freinds, been
depressed, been drinking, I still am.
I lost your link, and could not remember your name, except that it was a
fish and had something to do with a fish and avoiding GetDlgItem().

Well, I just wanted to say Hi. Appreciate all the help. No repsonse is
required or needed.

Regards,
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:c2i5m15un519nik27ds7cb06r2l3f9hlhs@xxxxxxxxxx
> My belief is that UpdateData should never be called. So I *only*
> manipulate controls
> independently. SetWindowText and GetWindowText work fine, without the
> problems of
> UpdateData. Key here is that you should eliminate all instances of
> GetDlgItem and all
> instances of UpdateData from your code. Note that UpdateData is not a
> member of CEdit, so
> would have no effect. I'm surprised that code like this would even
> compile.
>
> See my essays on avoiding GetDlgItem and avoiding UpdateData on my MVP
> Tips site.
>
> As to why the second one works, it is because it is manipulating the
> window. Again, using
> GetDlgItem is an exceptionally poor approach here. On the other hand. in
> the first
> example, at no time did you ever do anything to change the contents of the
> window.
> joe
>
> On Fri, 28 Oct 2005 13:59:09 -0700, "Thor" <junkforme@xxxxxxx> wrote:
>
>> Using VC++ 6 I have created an MFC exe Dialog project. On the Dialog are
>>many CEdit edit boxes. I have no problem updating data for the entire
>>dialog,
>>but I want to updata for only certain edit boxes at certain times. The
>>following code seems like it should work, but it doesn't; it just has no
>>effect.
>>
>> CEdit* myPoint;
>> myPoint=(CEdit*)GetDlgItem(IDC_EDIT2);
>> myPoint->UpdateData();
>>
>>It doesn't matter if it is UpdateData(TRUE) or UpdateData(FALSE).
>>
>>Similar code to show or hide CStatic texts works just fine.
>> CStatic* myPoint;
>> myPoint=(CStatic*)GetDlgItem(IDC_STATIC_0);
>> myPoint->ShowWindow(SW_HIDE);
> Joseph M. Newcomer [MVP]
> email: newcomer@xxxxxxxxxxxx
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: is it white-spot, velvet or both?
    ... i lost all three clown loaches (i saw some in a shop today and they ... I bought some new fish today also. ... :) I'm going to dilute my rock hard water with rain water I collected in a clean 30g plant tub. ... for velvet & white spot and another for bacterial infections, fin rot, ...
    (rec.aquaria.freshwater.misc)
  • Re: Yoko quote
    ... lost cause and that *sometimes* I make interesting posts. ... sarcasimacally saying "Praise from Caesar is Praise indeedy", ... Praise from the great Guru PR, is a glory to any whosoever it is bestowed. ... better and nicer person than that nasty Fatty, and that nasty Fish, the Guru ...
    (rec.music.beatles)
  • one dead fish
    ... Well I lost my first fish 2 days ago. ... I checked the water levels and all was good, except the nitrite was at about .1 ppm. ... I changed the water and did a sponge squeese into this tank from a sponge of another tank. ... The decisead fish was one of my glowlight rasboras, he was kind of a loner fron day one he didn't stay with the school much). ...
    (rec.aquaria.freshwater.misc)
  • Re: Reef tank and Loud music?
    ... I ran SPL levels up to 110-120 db's, ... sometimes for hours and never lost a thing ... The Reef Chemistry Forum ... would loud music effect the fish if the tank waS in the same room a band ...
    (rec.aquaria.marine.reefs)

Loading