I think my problems are because my vector holds pointers (vector < SCHEDULEBLOCK* >). I read Paul Wolfensberger's article "Using the std::sort() Method" before but I don't quite get it. This code works...; struct MySort { bool operator()(const SCHEDULEBLOCK* a, const SCHEDULEBLOCK* b) { return (a->ctBlockDate < b->ctBlockDate); } }; ... but it doesn't look that nice. /DrZOO
DrZOO
Posts
-
Sorting a vector -
Sorting a vectorIt looks nice, but for some reason i get an error; d:\Program Files\Microsoft Visual Studio .NET\Vc7\include\algorithm(1856): error C2064: term does not evaluate to a function which point to row 2 and 3 in the code below (from algorithm) while (_First < _Pfirst && !_Pred(*(_Pfirst - 1), *_Pfirst) && !_Pred(*_Pfirst, *(_Pfirst - 1))) --_Pfirst; Can you please help me? Should I pass some parameters to date_sort? Thanks once again lifesaver ;) /DrZOO
-
Sorting a vectorHello! I'm trying to use a vector, but it seems like I'm not that clever. How can I sort my vector by one of the Class attributes, in my case ctDate? typedef struct tagSCHEDULEBLOCK { CTime ctDate; CString csText; }SCHEDULEBLOCK; vector MyVector; Thanks for all your help! /DrZOO
-
Send message to childIt's nice with bright people!
-
Send message to childI really need to know how to get a handle or a pointer to a child view? I'm trying to do thar with GetWindow(), but how do I know which window the result is? Thanks for all your help /DrZOO
-
Send message to childHello I want to send messages from MainFrame to its child views (for example CView and CListView). In MainFrame there are tree views created from splitterwnd like this; m_wndSplitter2.CreateView(0,0, RUNTIME_CLASS(CUserListView), CSize (0, 0), NULL); Those are the ones I would like to send messages to. How do I do that? How do I get all neccesary handles/pointers to that view. /Yours truly ;)
-
Create view in a CTabCtrlHello rbc This is how my code for creating a CTabCtrl in a CView CRect rcClient(......); m_TabWeek.Create(TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE, rcClient, this, 0x1006); m_TabWeek.SetItemSize(CSize(45, 23)); csTabtext = ctWeek.Format("%W"); // If the label is "static" you only need to set pszText LPTSTR lpszTabtext = new TCHAR[csTabtext.GetLength()+1]; _tcscpy(lpszTabtext, csTabtext); TabItem.pszText = lpszTabtext; if(m_TabWeek.InsertItem(index, &TabItem) == -1) { AfxMessageBox("Unable to create week tab"); return false; } You're welcome! /DrZOO Chics are for fags!
-
Please help! -Window creationHi ya all! The following code i supposed to create a window inside another window. m_Page.CreateEx(WS_EX_LEFT | WS_EX_TOPMOST, AfxRegisterWndClass(CS_CLASSDC), _T(""), WS_VISIBLE | WS_CHILD, rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), m_hWnd, NULL); The window is created at program start (I'm able to paint in it), but at close I get; "Unhandled exception at 0x77f7f570 in kalender.exe: User breakpoint." Which point to; "77F7F570 int 3" in Disassembly If the mousepointer is in this window at program start it show a hourglass, until the pointer is moved outside this window. Thankfull for all your help /DrZOO ___________________ Chics are for fags!
-
Create view in a CTabCtrlI have created a CTabCtrl in a CView and would like to insert a CScrollView into it. I don't quite get it; should I use CWnd::Create or CWnd::CreateEx (I don't think I really need the dwExStyle). I've tried both but it doesn't seem to work (probably just me being stupid and handling wrong variables). Thank's for all your help /DrZOO :confused: (using VC.NET) Chics are for fags!