Version 10.2 Released
Version 10.2
Updated CMenuBar.
Updated IsXPThemed.
Added IsAppRunning(). Updated CMenuBar, CDC, CGDIObject, CMenu, CImageList and samples.
Updated CMenuBar.
Updated CWinApp, CDC, CImageList, CGDIObject, and CMenu
Updated samples.
Hi Andy, Yes the thread lock does go out of scope immediately as you described. Sorry for the misunderstanding. Best regards, David
Sorry for the delay - I didn't get any notification of your response. I understand locks/semaphores in general and understand why you might want one. The code removes the entry from the map at line 254 RemoveFromMap(). At that point the lock acquired at line 241 by instantiating a CThreadLock has been released - the destructor for CThreadLock is run before we get to Line 242 as mapLock goes out of scope. You can run through the sequence using a debugger to demonstrate this. Regards Andy
Updated CustomPrintDlg and Notepad samples.
Updated CMenuBar.
it works. thanks david
Hi Alan We can use the GetCWndPtr function to retrieve the CWnd pointer mapped to a window handle (HWND). If no CWnd pointer is mapped to the window handle, GetCWndPtr returns nullptr. If we want to get a pointer to the CMainFrame class from CView, we could do it like this: CMainFrame* pFrame = (CMainFrame*)GetCWndPtr(GetAncestor()); For this to work we also need to include the "Mainfrm.h" header file in View.cpp. In the example provided above, we could replace GetAncestor with GetParent for a simple...
thank david. I don't mean the above. For example, in the FrameEx sample program, CMainFrame has a function LoadPngResource. I want to use this function in CView, so I must get the pointer of CMainFrame in Cview. Or CMainFrame has other functions, such as SetStatusText. I want to use them in CView, and I also need to get the same CMainFrame pointer in Cview. So, my question is, how to get the pointer of CMainFrame in Cview?
Updated the FastGDI and Picture samples.
Hi Alan, If I understand correctly, you would like to know how to control the status bar when using a frame based application. The StatusBar sample demonstrates various ways to customize the status bar when used with a frame. Perhaps this sample provides a useful guide for what you need. Best regards, David
Hi Alan, If I understand correctly, you would like to know you to control the status bar when using a frame based application. The StatusBar sample demonstrates various ways to customize the status bar when used with a frame. Perhaps this sample provides a useful guide for what you need. Best regards, David
There is a view in the mainframe. How to get the frame in this view to set the status bar or other frame functions
Hi Andy, The thread lock in wxx_menu.h is not a bug. CThreadLock installs a Critical Section which ensures that one thread and one thread only runs a section of code. When the CThreadLock object goes out of scope, the Critical Section is removed. In multi-threaded environments, several threads can attempt to modify a variable at the same time. This attempt can fail or leave the variable in an unknown state. A Critical Section ensures that only one thread at a time modifies the variable. This keeps...
Hi David I've just been updating to Release 10.1. That has revealed a fault in my code (destroying cascading popup menus before they are used - I have failed to identify what change in 10.1 has led to this fault surfacing 😟) In investigating this fault, I noticed a bug in Win32++. In wxx_menu.h line 240, there is an attempt to get a thread lock if the application is initialised. Of course the lock goes out of scope immediately the conditional completes. I don't know if there are other instances of...
Added CFolderDialogEx.
Updated Help
Added the TaskDialogBox global function.
Updated DarkModeFrame sample.
Hi Daniel, I've updated the CDocker code to resolve the issues you've mentioned. You can download the latest code snapshap from the Code section here on SourceForge. Best regards, David
Updated CDocker and the docking samples.
Thanks a lot David! Another observation related to Dock.exe and DockContainer.exe: 1. close almost all dockers, leaving only one open 2. restart the app 3. observe that the previous layout is preserved (one docker only) 4. close also the last docker (from DockContainer.exe -> menu -> Docking -> Close All) 5. restart the app 6. observe that the layout is reset to default I think this is because CDocker::LoadDockRegistrySettings sets isLoaded = TRUE only when dockList.size() > 0: is this expected?...
Hi Daniel The standard way of moving a window in Microsoft Windows is to click and drag the window's caption area. When Win32++ undocks a window it repositions the window such that the center of the window's caption area is under the mouse pointer. This is by design. Presumably, you could reduce the "jump" in the window's position by positioning the container tabs at the top rather than the bottom of the container. As for the second issue you mentioned, undocking a window should not remove the maximized...
Updated FastGDI and Picture samples.
Hi David, in the DockContainer sample I noticed that undocking a view will make it jump to the current cursor position... This looks a bit odd when the app is maximized because then the newly undocked view can get easily out of the screen. I couldn't add pictures here, so I added some details on Win32xx/issues/14. Kindly please check if it makes sense to do such a change (to avoid that jump). And a second issue observed with the DockContainer.exe: - undocking one of the "Output" views doesn't un-maximize...
Thanks David, they work fine now!
Thanks Daniel. I've updated the TextFileReader and Tray samples to fix the problem you've described. You can download the latest SVN Snapshot from the Code section here on SourceForge. Best regards, David
Updated TextFileReader sample.
Hi David, I noticed that in TextFileReader demo, pressing F1 multiple times trigger more than one About dialog: after that only the last one can be closed, the other ones not, and then the TextFileReader.exe has to be killed from Task Manager. An almost similar behaviour is for Tray demo, but there all the opened ones can be closed (with OK in any order, or with Esc in reverse opening order). If you find the route case for both, can you please provide a fix? Thank you, Daniel
Ok, thank you for the explanation! Kind regards, Daniel
Hi Daniel, The Left(), Mid() and Right functions don't return a reference. They return a new CString instead. They can't be altered to return a reference without breaking existing code. The Compare() function returns an int. That can't be changed. The few functions that currently return void could return a self reference, but that doesn't look particularly useful. I can't think of any advantages to this approach in the cases where it could be applied. Best regards, David
Kind of similar to Left(), Mid(), Right(), etc, maybe Append(), Assign(), Trim() and others could return reference to itself, so that several operations can then be chained in one line, for example: str.Trim().Left(7).MakeLower().Compare(_T("-debug=")) Can this be done? Is it a good practice or does it bring more drawbacks than advantages? Thanks, Daniel
Added ToolbarBuilder sample.
Extended CBitmapInfoPtr.
Updated the MovieShow sample.
Updated EdgeBrowserEx sample.
Updated CResizer and CDocker.
Updated the Titlebar and TitlebarFrame samples
Fix for the Splitter sample and WIN32_LEAN_AND_MEAN.
Updated toolbar bitmaps in samples.
Fixed CMDIFrameT::AddMDIChild
Updated CMenuBar.
Updated project files
Updated IFileDialog sample.
Added IFileDialog sample.
Updated support for Embarcadero's C++ Builder.