Buggy MFC or just me??
-
I am wondering if anyone else has seen this maybe bug in mfc code or if its just something I am doing. I have am using a CListCtrl ( ick! but anyway ) and am adding text. The list ctrl. has 2 colums. The list ctrl is on a prop. page and so during the DDX i have something that looks like
for( i = 0; i < somenum; i++ ) {
someptr = GetSomePtr();
list.InsertItem( i , someptr->textstring );
for( j = 0; j < someothernum; j++ ) {
someotherptr = GetSomeOtherPtr();
if( someotherptr->ID == someptr->ID ) {
list.SetItemText( i, 1, someotherptr->titletext );
}
}
}So my question is... has anyone else noticed when doing something similar that the text set during setitemtext doesn't show up on first update.. I know the code is right cause if you flip to some other prop page and then flip back is shows up fine.... one solution ( just as a test ) was to add an extra UpdateData(FALSE) to the InitDialog() function... This worked but is kind of a pathetic resolution... I know people are bound to try to ream me for posting a programming question but this really ISN'T a programming question.... i just wanna know if anyone has seen this bug before... i'm not really looking for a solution from anyone. Anyone seen any other interesting bugs in MFC framework... i've ran across a few in my time working with MFC.. they are annoying as hell cause you spend like 5 days trying to find out what in YOUR source code is wrong only to find that M$ f***ed up!! Joseph Dempsey jdempsey@cox.rr.com Joseph.Dempsey@thermobio.com --And though --We are not now that strength which in old days --Moved earth and heaven, that which we are, we are, --One equal temper of heroic hearts --Made weak by time and faith, but strong in will --To strive, to seek, to find, and not to yield. +++ Ulysses (Alfred. Lord Tennyson)
-
I am wondering if anyone else has seen this maybe bug in mfc code or if its just something I am doing. I have am using a CListCtrl ( ick! but anyway ) and am adding text. The list ctrl. has 2 colums. The list ctrl is on a prop. page and so during the DDX i have something that looks like
for( i = 0; i < somenum; i++ ) {
someptr = GetSomePtr();
list.InsertItem( i , someptr->textstring );
for( j = 0; j < someothernum; j++ ) {
someotherptr = GetSomeOtherPtr();
if( someotherptr->ID == someptr->ID ) {
list.SetItemText( i, 1, someotherptr->titletext );
}
}
}So my question is... has anyone else noticed when doing something similar that the text set during setitemtext doesn't show up on first update.. I know the code is right cause if you flip to some other prop page and then flip back is shows up fine.... one solution ( just as a test ) was to add an extra UpdateData(FALSE) to the InitDialog() function... This worked but is kind of a pathetic resolution... I know people are bound to try to ream me for posting a programming question but this really ISN'T a programming question.... i just wanna know if anyone has seen this bug before... i'm not really looking for a solution from anyone. Anyone seen any other interesting bugs in MFC framework... i've ran across a few in my time working with MFC.. they are annoying as hell cause you spend like 5 days trying to find out what in YOUR source code is wrong only to find that M$ f***ed up!! Joseph Dempsey jdempsey@cox.rr.com Joseph.Dempsey@thermobio.com --And though --We are not now that strength which in old days --Moved earth and heaven, that which we are, we are, --One equal temper of heroic hearts --Made weak by time and faith, but strong in will --To strive, to seek, to find, and not to yield. +++ Ulysses (Alfred. Lord Tennyson)
Bugs, bugs, bugs - Yeah, Windows and MFC are full of them. I spend about half my time trying to work around bugs in Windows. Though I think that MFC has fewer bugs, just a lot of bad design (my guess is that in your example, the list control is to blame, not MFC). My latest bug: DWORD dwAttributes = SFGAO_FOLDER | SFGAO_LINK | SFGAO_READONLY | SFGAO_HASSUBFOLDER | SFGAO_CANRENAME | SFGAO_CANDELETE; pParentShellFolder->GetAttributesOf(1, relativePidl, &dwAttributes); m_bReadOnly = ((dwAttributes & SFGAO_READONLY) != 0); Would you believe that IShellFolder does not set the SFGAO_READONLY flag for a CD-ROM?
-
I am wondering if anyone else has seen this maybe bug in mfc code or if its just something I am doing. I have am using a CListCtrl ( ick! but anyway ) and am adding text. The list ctrl. has 2 colums. The list ctrl is on a prop. page and so during the DDX i have something that looks like
for( i = 0; i < somenum; i++ ) {
someptr = GetSomePtr();
list.InsertItem( i , someptr->textstring );
for( j = 0; j < someothernum; j++ ) {
someotherptr = GetSomeOtherPtr();
if( someotherptr->ID == someptr->ID ) {
list.SetItemText( i, 1, someotherptr->titletext );
}
}
}So my question is... has anyone else noticed when doing something similar that the text set during setitemtext doesn't show up on first update.. I know the code is right cause if you flip to some other prop page and then flip back is shows up fine.... one solution ( just as a test ) was to add an extra UpdateData(FALSE) to the InitDialog() function... This worked but is kind of a pathetic resolution... I know people are bound to try to ream me for posting a programming question but this really ISN'T a programming question.... i just wanna know if anyone has seen this bug before... i'm not really looking for a solution from anyone. Anyone seen any other interesting bugs in MFC framework... i've ran across a few in my time working with MFC.. they are annoying as hell cause you spend like 5 days trying to find out what in YOUR source code is wrong only to find that M$ f***ed up!! Joseph Dempsey jdempsey@cox.rr.com Joseph.Dempsey@thermobio.com --And though --We are not now that strength which in old days --Moved earth and heaven, that which we are, we are, --One equal temper of heroic hearts --Made weak by time and faith, but strong in will --To strive, to seek, to find, and not to yield. +++ Ulysses (Alfred. Lord Tennyson)
Hello Joseph, I tried to reproduce your bug by adding a CListCtrl to one of my property pages and I was unable to see the problems you were. Might be helpful to see your InitDialog and list population routines. Kind regards, Tim