Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMFC list view control question.... Pin
David Z25-Feb-02 17:35
David Z25-Feb-02 17:35 
GeneralRe: MFC list view control question.... Pin
Nish Nishant25-Feb-02 18:15
sitebuilderNish Nishant25-Feb-02 18:15 
GeneralRe: MFC list view control question.... Pin
Ravi Bhavnani25-Feb-02 18:27
professionalRavi Bhavnani25-Feb-02 18:27 
GeneralRe: MFC list view control question.... Pin
David Z25-Feb-02 18:35
David Z25-Feb-02 18:35 
GeneralRe: MFC list view control question.... Pin
Nish Nishant25-Feb-02 18:41
sitebuilderNish Nishant25-Feb-02 18:41 
GeneralRe: MFC list view control question.... Pin
Ravi Bhavnani25-Feb-02 18:53
professionalRavi Bhavnani25-Feb-02 18:53 
GeneralRe: MFC list view control question.... Pin
David Z25-Feb-02 19:09
David Z25-Feb-02 19:09 
GeneralRe: MFC list view control question.... Pin
Ravi Bhavnani25-Feb-02 19:23
professionalRavi Bhavnani25-Feb-02 19:23 
You can associate application specific data with items in a list control by calling CListCtrl::SetItemData(). Typically, the item data (a DWORD) is a pointer to an object whose information will be rendered by the list control for that row.

Aside:
The object represents the "model" and the list control (whose only job is to render items and be responsive to mouse and keyclicks) represents the "view" and "controller" in the MVC (model-view-controller) design pattern.


Your (owner drawn) list control will display the appropriate information in each column based on the item's data. When you want to copy chunks of one list control to another (or even within the same list control), all you need to do is to update the target list control's item data for the appropriate rows and invalidate the list control (to force a redraw). You don't need to copy the actual column data of the rows being copied.

/ravi

"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
GeneralRe: MFC list view control question.... Pin
David Z25-Feb-02 19:31
David Z25-Feb-02 19:31 
GeneralRe: MFC list view control question.... Pin
Nish Nishant25-Feb-02 20:14
sitebuilderNish Nishant25-Feb-02 20:14 
GeneralIcon Question.... Pin
Joseph Dempsey25-Feb-02 15:16
Joseph Dempsey25-Feb-02 15:16 
GeneralRe: Icon Question.... Pin
Shog925-Feb-02 15:49
sitebuilderShog925-Feb-02 15:49 
GeneralGDI+ question! Pin
G.Richard25-Feb-02 14:16
G.Richard25-Feb-02 14:16 
GeneralClipping Pin
alex.barylski25-Feb-02 13:19
alex.barylski25-Feb-02 13:19 
GeneralRe: Clipping Pin
Shog925-Feb-02 15:51
sitebuilderShog925-Feb-02 15:51 
GeneralRe: Clipping Pin
alex.barylski25-Feb-02 18:50
alex.barylski25-Feb-02 18:50 
GeneralRe: Clipping Pin
Paul M Watt25-Feb-02 19:10
mentorPaul M Watt25-Feb-02 19:10 
GeneralRe: Clipping Pin
Shog925-Feb-02 19:47
sitebuilderShog925-Feb-02 19:47 
QuestionDoc/view question...?? Pin
alex.barylski25-Feb-02 13:15
alex.barylski25-Feb-02 13:15 
AnswerRe: Doc/view question...?? Pin
Jay Beckert25-Feb-02 13:43
Jay Beckert25-Feb-02 13:43 
GeneralRe: Doc/view question...?? Pin
alex.barylski25-Feb-02 14:06
alex.barylski25-Feb-02 14:06 
GeneralRe: Doc/view question...?? Pin
Jay Beckert26-Feb-02 10:37
Jay Beckert26-Feb-02 10:37 
AnswerRe: Doc/view question...?? Pin
Mazdak25-Feb-02 17:01
Mazdak25-Feb-02 17:01 
Generalvc6 macros: Object model shortcomings & bugs Pin
rseidl25-Feb-02 11:29
rseidl25-Feb-02 11:29 
GeneralRe: vc6 macros: Object model shortcomings & bugs Pin
J Patel25-Feb-02 11:36
J Patel25-Feb-02 11:36 

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.