#include time_t now; struct tm *newtime; char todaysDate[128]; // get the number of seconds since January 1, 1970 time(&now); // get the current system date newtime = localtime(&now); todaysDate = asctime(newtime));
Hin Jang
Posts
-
how to get the date -
preventing the user from closing a floating toolbarthanks. i implemented the solution and it works just fine.
-
vertical floating toolbar// in your CMainFrame class, create a CToolBar // that includes the TBSTYLE_WRAPABLE and // CBRS_SIZE_FIXED flags. // next, call the SetRows() method. have a look // at the MSDN docs for a full desciption of the // method and its parameters. int numRows; // TODO: initialise this value m_wndToolBarFloat.GetToolBarCtrl().SetRows(numRows, true, 0); // last, dock the tool to the left or right side // of the MDI frame m_wndToolBarFloat.EnableDocking(CBRS_ALIGN_LEFT | CBRS_ALIGN_RIGHT); EnableDocking(CBRS_ALIGN_ANY); DockControlBar(&m_wndToolBarFloat);
-
preventing the user from closing a floating toolbarby default a floating toolbar that is not docked has the red 'x' at the top-right corner to allow users to close the toolbar. does anyone know how to disable/remove that 'x' so the toolbar will always exist in the client area of an MDI app? thanks for any help. take care.
-
menu dropshadow flickers when ontop of MDI child windowbackground info: i currently have an MDI app (created with Visual Studio .NET 2003) that can properly create new child windows. each of these windows contains a rendered scene via OpenGL. all of my OpenGL calls are invoked from within an overloaded OnPaint() method. i enabled double-buffering so animations are smooth. i also overloaded the OnEraseBkgnd() method so the background will not be repainted when the child window is resized. the problem: when i make a selection from the main menu bar i noticed the menu dropshadow flickers when it occludes/overlays a portion of the child window. my first assumption was that my scenes were too complex; the flickering exposes the slow "repaints" of the scene. as such, i made the necessary changes so that each child window only displays a blank grey background. the problem, however, persists for even this most simple of scenes. i next looked up the online documentation regarding the CWnd::OnPaint() method. the docs state the framework calls OnPaint() only once by default. to verify this i set a breakpoint in my OnPaint() method only to discover it gets called dozens of times! i suspect the flickering is due to the framework calling the OnPaint() over and over and over again. an artifact from the time-consuming "repaints" is this flickering of the menu dropshadows. does anyone have any suggestions on how to ensure that OnPaint() is only called when necessary? any help would be greatly appreicated. thanks.
-
changing the menu bar due to a drop-down list selectionfor my MDI app, i have a toolbar with a drop down list that is properly initialised and created. i can capture/detect when the user selects a given item from the list. desired functionality: whenever the user selects an item from the drop-down list, i want to change the contents of the main menubar. i read the online docs for Microsoft Visual C++ .NET regarding the CMDIFrameWnd::MDISetMenu method. at first glance this is what i want but the article suggests that we should not "call this member function if you use the framework to manage your MDI child windows". any helpful suggestion would be appreciated. thanks.