Click here to Skip to main content
15,899,937 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: Need help with sychronizing list control datas in different windows Pin
Derek Waters26-Feb-02 18:48
Derek Waters26-Feb-02 18:48 
Hi,

Your problem (which I assume is an assertion when running, not compiling) is that when you call SetItemData in your OnListSortByDay() function, the list control does not exist (if you look at the assertion, it will assert on (m_hWnd == NULL), ie. your control hasn't been created yet). All of the creation is done once you call DoModal. But of course, as it's modal, you can't call any subsequent functions in OnListSortByDay().

So, here's my suggestion. I'm sure other people will have others. In your GenList class, create a public function called SetCopyFromList, where you pass in a CListCtrl pointer:

void GenList::SetCopyFromList(CListCtrl *apCopyDataFrom);

In that function, store the pointer for later use in a member variable of GenList. Then, in the OnInitDialog() handler for GenList, you can use this pointer to obtain data for your list control, safe in the knowledge that m_SortList has been created.

Another alternative would be to override GenList::DoModal() with another function such as GenList::DoModal(CListCtrl *apCopyDataFrom) and then call CDialog::DoModal() inside that function.

Hope this helps.


------------------------
Derek Waters
derek@lj-oz.com
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 
GeneralRe: CWnd destruction Pin
Nish Nishant26-Feb-02 15:14
sitebuilderNish Nishant26-Feb-02 15:14 

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.