Click here to Skip to main content
15,921,660 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: just typing error Pin
moliate26-Feb-02 22:02
moliate26-Feb-02 22:02 
Generalfile not found Pin
26-Feb-02 20:01
suss26-Feb-02 20:01 
GeneralRe: file not found Pin
Nish Nishant26-Feb-02 20:24
sitebuilderNish Nishant26-Feb-02 20:24 
GeneralHelp with OnKillFocus Pin
John Cruz26-Feb-02 19:39
John Cruz26-Feb-02 19:39 
GeneralRe: Help with OnKillFocus Pin
Derek Waters26-Feb-02 20:03
Derek Waters26-Feb-02 20:03 
GeneralRe: Help with OnKillFocus Pin
John Cruz26-Feb-02 20:00
John Cruz26-Feb-02 20:00 
GeneralRe: Help with OnKillFocus Pin
Joaquín M López Muñoz26-Feb-02 20:00
Joaquín M López Muñoz26-Feb-02 20:00 
GeneralNeed help with sychronizing list control datas in different windows Pin
David Z26-Feb-02 17:50
David Z26-Feb-02 17:50 
Ok, I have been trying to get this to work for a while now. Dead | X| The response I got from my previous thread helped me in theory but didn't help my code.. Confused | :confused: so I'm posting a more detailed question if anyone can help me. I have a dialog based MFC app with a child listcontrol in report view. I then created another class for another window that will display another listcontrol but with the exact same column and data in it. My problem is that I can't copy the data over with what i've tried.. I have the user add item to the first list using SetItemData(). Like the following->

listitems.mask = LVIF_TEXT;
listitems.iItem = 0;
listitems.iSubItem = 0;
listitems.pszText = (LPTSTR)(LPCTSTR)(strTitle);
m_MyList.InsertItem(&listitems);

listitems.mask = LVIF_TEXT;
listitems.iSubItem = 1;
listitems.pszText = (LPTSTR)(LPCTSTR)(m_strFirstName);
m_MyList.SetItem(&listitems); ...... There are five columns

and then when the user clicks a menu item it will open up another window showing the listcontrol that is supposed to show the same data. Here is the code for that->

void CMFCDlg::OnListSortbyday()
{
DWORD_PTR tempdata = m_MyList.GetItemData(0);
GenList SortWindow;
SortWindow.m_SortList.SetItemData(0,tempdata);
SortWindow.DoModal();
}

m_MyList is a public member CListCtrl of the main window, and m_SortList is a public member CListCtrl of the newly opened window.
This is my most recent try at getting this to work... I get an assertion error when compiling though....Mad | :mad:

My previous methods were declaring m_SortList as a CListCtrl pointer and point it to m_MyList, or setting the DDX_Control of the listview to CMFCDlg::m_MyList, but neither methods worked. I'm sure there is a way to get this to work.. Maybe making an instance of my main window.. but I don't know how to do that... So can someone guide me in the right direction? I don't want to just loop through and copy every single row, but I may have to.. Please help me out with some explicit instructions and sample code. Thanks!!Big Grin | :-D

Sorry for the long post..
GeneralRe: Need help with sychronizing list control datas in different windows Pin
Derek Waters26-Feb-02 18:48
Derek Waters26-Feb-02 18:48 
GeneralRe: Need help with sychronizing list control datas in different windows Pin
David Z26-Feb-02 20:58
David Z26-Feb-02 20:58 
GeneralRe: Need help with sychronizing list control datas in different windows Pin
peterchen27-Feb-02 5:48
peterchen27-Feb-02 5:48 
GeneralRe: Need help with sychronizing list control datas in different windows Pin
David Z27-Feb-02 10:46
David Z27-Feb-02 10:46 
GeneralFinding Child Windows Pin
Alan Blakely26-Feb-02 16:20
Alan Blakely26-Feb-02 16:20 
GeneralRe: Finding Child Windows Pin
Daniel Ferguson26-Feb-02 18:01
Daniel Ferguson26-Feb-02 18:01 
GeneralCWnd destruction Pin
alex.barylski26-Feb-02 13:30
alex.barylski26-Feb-02 13:30 
GeneralRe: CWnd destruction Pin
Jay Beckert26-Feb-02 13:57
Jay Beckert26-Feb-02 13:57 
GeneralRe: CWnd destruction Pin
alex.barylski26-Feb-02 13:57
alex.barylski26-Feb-02 13:57 
GeneralRe: CWnd destruction Pin
Christian Graus26-Feb-02 14:06
protectorChristian Graus26-Feb-02 14:06 
GeneralRe: CWnd destruction Pin
alex.barylski26-Feb-02 15:04
alex.barylski26-Feb-02 15:04 
GeneralRe: CWnd destruction Pin
Christian Graus26-Feb-02 15:02
protectorChristian Graus26-Feb-02 15:02 
GeneralRe: CWnd destruction Pin
Nish Nishant26-Feb-02 15:15
sitebuilderNish Nishant26-Feb-02 15:15 
GeneralRe: CWnd destruction Pin
Nish Nishant26-Feb-02 14:27
sitebuilderNish Nishant26-Feb-02 14:27 
GeneralRe: CWnd destruction Pin
Atul Dharne26-Feb-02 14:53
Atul Dharne26-Feb-02 14:53 
GeneralRe: CWnd destruction Pin
Nish Nishant26-Feb-02 14:57
sitebuilderNish Nishant26-Feb-02 14:57 
GeneralRe: CWnd destruction Pin
alex.barylski26-Feb-02 15:08
alex.barylski26-Feb-02 15:08 

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.