Click here to Skip to main content
15,915,501 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: API: replacing chars Pin
User 665828-Apr-02 9:16
User 665828-Apr-02 9:16 
GeneralRe: API: replacing chars Pin
Tom Archer28-Apr-02 9:24
Tom Archer28-Apr-02 9:24 
GeneralRe: API: replacing chars Pin
Joaquín M López Muñoz28-Apr-02 9:16
Joaquín M López Muñoz28-Apr-02 9:16 
GeneralRe: API: replacing chars Pin
User 665828-Apr-02 9:28
User 665828-Apr-02 9:28 
GeneralRe: API: replacing chars Pin
Joaquín M López Muñoz28-Apr-02 11:33
Joaquín M López Muñoz28-Apr-02 11:33 
GeneralRe: API: replacing chars Pin
Nish Nishant28-Apr-02 14:13
sitebuilderNish Nishant28-Apr-02 14:13 
GeneralRe: API: replacing chars Pin
Mike Nordell1-May-02 10:19
Mike Nordell1-May-02 10:19 
GeneralCListView & Appending Items :: MFC Pin
valikac28-Apr-02 7:41
valikac28-Apr-02 7:41 
Hi.

I implemented a listview in a program. It works great, but not perfect. I have experience problems. First, the listview insert and display new item perfectly the if it was empty before insertion. For example.

// assume listview is empty

-----
CListView &lc = GetListCtrl();

for (int i = 0; i < 10; ++i)
lc.InsertItem(0, "testing");
-----

The code above will insert ten "testing" strings into the listview control. CListView will update the window with the ten items. However, let say that I want to add more items. Here is a technique I use.

-----
CListView &lc = GetListCtrl();
lc.DeleteAllItems();

int i;
for (i = 0; i < 10; ++i)
lc.InsertItem(i, "testing");

// inserting new lines

for (int j = i; i < 20; ++j)
lc.InsertItem(j, "new items");

Okay. The code above should work. However, sometimes CListView will not display the updated data. Again, in the example above, the program will not update the window with "new items." This seems to happen when I start to add a lot of items (100 or more). Is there some kind of a limit on the CListCtrl?

What is the proper way to add, remove, and clear a CListCtrl *and* properly redraw everything correctly?

Thanks,
Kuphryn
GeneralRe: CListView & Appending Items :: MFC Pin
l a u r e n28-Apr-02 12:30
l a u r e n28-Apr-02 12:30 
GeneralRe: CListView & Appending Items :: MFC Pin
Shog928-Apr-02 12:41
sitebuilderShog928-Apr-02 12:41 
GeneralRe: CListView & Appending Items :: MFC Pin
Ravi Bhavnani28-Apr-02 13:01
professionalRavi Bhavnani28-Apr-02 13:01 
GeneralRe: CListView & Appending Items :: MFC Pin
valikac28-Apr-02 13:13
valikac28-Apr-02 13:13 
GeneralRe: Solution Pin
valikac28-Apr-02 13:14
valikac28-Apr-02 13:14 
QuestionNew class in dialog program? Pin
28-Apr-02 7:40
suss28-Apr-02 7:40 
AnswerRe: New class in dialog program? Pin
Andres Manggini28-Apr-02 7:59
Andres Manggini28-Apr-02 7:59 
GeneralWin API - Help with sizing windows Pin
ParaSwarm28-Apr-02 7:02
ParaSwarm28-Apr-02 7:02 
GeneralRe: Win API - Help with sizing windows Pin
Ravi Bhavnani28-Apr-02 7:18
professionalRavi Bhavnani28-Apr-02 7:18 
GeneralChanging executable icon Pin
28-Apr-02 6:16
suss28-Apr-02 6:16 
GeneralRe: Changing executable icon Pin
Joaquín M López Muñoz28-Apr-02 9:25
Joaquín M López Muñoz28-Apr-02 9:25 
GeneralRe: Changing executable icon Pin
28-Apr-02 11:05
suss28-Apr-02 11:05 
General*.tli and *.tlh editing Pin
Aviv Halperin28-Apr-02 5:41
Aviv Halperin28-Apr-02 5:41 
GeneralRe: *.tli and *.tlh editing Pin
Tom Archer28-Apr-02 6:10
Tom Archer28-Apr-02 6:10 
GeneralRe: *.tli and *.tlh editing Pin
Aviv Halperin28-Apr-02 7:25
Aviv Halperin28-Apr-02 7:25 
GeneralRe: *.tli and *.tlh editing Pin
Tom Archer28-Apr-02 7:31
Tom Archer28-Apr-02 7:31 
Generaledit box stuff Pin
28-Apr-02 5:17
suss28-Apr-02 5:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.