CComboBox only accept number in VC++ ???
I need to create a combo box in MFC /VC++ in which user can enter or select values in between 0 to 9999 only. How can I acheive this functionality. Please Help ...
I need to create a combo box in MFC /VC++ in which user can enter or select values in between 0 to 9999 only. How can I acheive this functionality. Please Help ...
How do I have a CEdit control display placeholder text when it's empty, similar to the behavior of NSTextFields in Cocoa? ...
Does anyone know why MFC's CWnd::CreateControl does not appear to successfully create some ActiveX controls, for example VBA's Label control. (PROGID: "Forms.Label")? I suspect it can't support windowless ActiveX controls, can anyone confirm this? I have workarounds (ATL), I'd just prefer to use a CWnd. ...
I noticed if a create an ActiveX control with an MFC CWnd and call ShowWindow(SW_HIDE) or SetWindowPos to hide the window the internal m_hWnd of the class is set to NULL. Debugging into MFC revealed that some sort of "OLE Verb" was being executed on the object, which I think indirectly is nulling out my handle. Anyone know why? Modify...
I have a list of items (potentially large) from which the user must select one. I'd like to allow the user to type the first few letters of the desired item to jump to the correct place in the list. By default, each keypress jumps to the first item starting with that letter, so you can't type the first several letters. Is there any st...
I have a CListCtrl with plenty of room for all of the items, and they all display correctly --- until selected! As soon as any entry is selected, the end of that entry is truncated and an ellipsis is added: Click for Image I have no idea why this is happening. You can't see it in this image, but even very short entries show this beha...
Hi... I made a very simple MFC application that call a Dialog when I click in a button, and send a MessageBox after 5 seconds. The problem is, when I was in the second dialog and I dismiss the MessageBox from the parent (not click OK button of MessageBox. I click in a blank part of the second dialog) I cannot close this dialog (The sec...
I'd like to implement a function with the prototype /* Locates the menu item of the application which caused the given menu 'mnu' to * show up. * @return true if the given menu 'mnu' was opened by another menu item, false * if not. */ bool getParentMenuItem( HMENU mnu, HMENU *parentMenu, int *parentMenuIdx ); Given a HMENU handle,...
About the following code, it is written by MFC, but in test time, i run the simple program, i will not got a normal case, the program will return a failed message to me, the message is "Can't play file:[PATH]". but if me fixed the File (not select form the the dialog), it is work, i can not find out the problem, i hope some people can h...
I have a large MFC application that I am extending to allow for multi-lingual input. At the moment I need to allow the user to enter Unicode data in edit boxes on a single dialog. Is there a way to do this without turning UNICODE or MBCS on for the entire application? I only need a small part of the application converted at the moment...
Inside my app, I want to send a message to a dialog from a different thread. I want to pass an std::exception derived class reference to the dialog. Something like this: try { //do stuff } catch (MyException& the_exception) { PostMessage(MyhWnd, CWM_SOME_ERROR, 0, 0); //send the_exception or the_exception.error_string() here }...
I've made a simple MFC application (Visual Studio 2008, dialog based) and added a CComboBox using the resource editor. I used the resource editor to specify the dropdown height. Then I added some code to add 100 texts to the combobox. If I run this simple application the dropdown height is ignored. If I disable the Microsoft.Windows.Com...
I have some legacy MFC apps, and I'd like to use the Cairo drawing engine to add some charts and graphs. I'm searching for a small example of how to get that to work. Basically, once I've created a PNG or GIF file, how do I get that show up in an MFC CView window? My google-fu is not finding any good clues. ...
Hi I need to extend the CListControl class in C++/MFC, which will add several new features in the list control, Any one have good sample code ? Or could you please tell me how can i start it ? Thanks in advance! Or just write the new features and listControl into a ActiveX or COM ?? Which is better ? ...
It's very stange, but I moved from VS2005 to VS2008 (MFC, VC++) and now the recompiled program causes a BSOD or a reboot on XP SP2 (works ok on SP3 and above). It doesn't get to InitInstance. Has anyone experienced this and knows where to look to fix it? I'm tinkering with project settings at the moment, but unsuccessfully so far. Debu...
In reference to this question:Which is prefered CTabCtrl vs CPropertySheet I have a DDK that uses MFC which I am new to. The basic example from the DDK implements a simple dialog box with 3 tabs with the "Ok" and "Cancel" button on the right side of the box. Based on the question from the link above, seems like only CTabCtrl can have...
What is the relation ship between CRITICAL_SECTION and CCriticalSection. is CCriticalSection a wrapper of CRITICAL_SECTION? BTW: I think the following code is meanless because the cs is not Global, it initial every times before lock() so it can't lock the XXX , is it ? int func { CCriticalSection cs; cs.Lock(); XXX cs.Unlock(); } Ma...
When i found some questions, i always try to go to www.codeproject.com and www.codeguru.com to find some sample projects or tutorial. But sometime i found the resources from the codeproject and codeguru are not enought. So can someone suggest me some better website which contains useful sample projects or tutorial about C++/MFC ... ? T...
We're developing/supporting 2 large MFC applications, using VS 2005. Currently, we are looking at various MFC GUI/controls component libraries: www.bcgsoft.com : "BCGControlBar Pro" www.codejock.com : "Toolkit Pro" www.prof-uis.com : "Prof-UIS" others? The samples/demos provided for those look all great, and the feature sets seem to...
I want to capture following attributes from print server spool on print of any page. i am able to capture 3 of 4 attributes through these APIs(FindFirstPrinterChangeNotification, FindNextPrinterChangeNotification). but still i am not able to get data of file(so i can keep the thumbnail of this file by page by page) Computer Name - DONE ...