mfc

C++ MFC: How to open immediately a secondary dialog after the first modal dialog was created.

Hi, how can I open a secondary modal dialog in C++ MFC from a dialog without pressing any button? (If I create a dialog in OnInitDialog(), the first dialog won't appear.) ...

Can't add event handler in visual studio 2010 (mfc project)

I've recently converted an MFC visual studio 6.0 project to a visual studio 2010 project and I'm experiencing problems whenever I try to add event handlers to controls on certain forms within my project. On one particular page I have a radio button and I've tried to add a click event handler to it using 3 different ways: 1) By right cl...

COleDateTimeSpan: GetTotalDays vs GetDays

Both functions GetTotalDays and GetDays of COleDateTimeSpan class returns number of days contained in object: GetTotalDays: http://msdn.microsoft.com/en-us/library/d22h87z4(v=VS.80).aspx This date/time-span value expressed in days GetDays: http://msdn.microsoft.com/en-us/library/ze8kz4yw(v=VS.80).aspx The day portion of this d...

DrawFrameControl for a Combobox in MFC

basically i wish to give button like look and feel to my combo box just like combo's in windows7 ...

Changing CFrameWnd to CFrameWndEx in MFC causes unhandled exception - any ideas?

Still getting used to this MFC lark and I've hit a brick wall on this particular problem. I'm updating some legacy code to use some of the more refined controls available in the MFC Feature Pack. Following the examples given online for updating an old MFC app, changing the base application class to CWinAppEx works fine, but when I chan...

Why is a CListCtrl responding to LVM_GETVIEW with LV_VIEW_ICON when that CListCtrl's view/display style is LVS_REPORT?

I'm working on UI-driven test automation, and the app under test (AUT) has a UI implemented with C++/MFC/Prof-UIS. My team employs Ranorex to author the tests. Experience has shown that Ranorex does not properly navigate the list controls (instances of CListCtrl) in the AUT. They all have multiple columns, and Ranorex will only retrieve ...

MFC: hiding a toolbar button

I'm currently disable certain buttons by handling ON_UPDATE_COMMAND_UI and calling ->Enable( TRUE / FALSE ). What would be the best way to completely hide the button instead? I've tried using HideButton and that makes the button image invisible, but it still takes up space so there is a blank area between visible buttons. Thanks. ...

MFC winsock1 and 2

Hi all, I'm deep in trouble with my project. I have to link two radar with my program, but the first has its own library that uses winsock, while in the second I want to use winsock2. How can i do that? At the moment i get many redefinition errors from the includes within winsock.h and winsock2.h. Take into account that the first ra...

How to tell whether Win32 WM_POWERBROADCAST message has interrupted a call stack

How can you tell whether a WM_POWERBROADCAST message has interrupted a call stack? As opposed to happening in isolation with just the message handler call stack? Here's the background: What I see is that during hibernate / resume I get WM_POWERBROADCAST messages. These can seemingly interrupt a (blocked/waiting) callstack for e.g. a WM_...

'Encountered an improper argument' Only on Windows Server 2008 with CFileDialog

I have the following code to get a valid file name CFileDialog *MyDlg(new CFileDialog(FALSE,NULL,0,OFN_HIDEREADONLY|OFN_FILEMUSTEXIST,"CSV (*.csv)|*.csv||",NULL)); bool done = false; CString sFileName = ""; while ( !done ) { /* (Keep looping until we get a "good" filename) */ if ( MyDlg->DoModal() != IDOK ) return; ...

how to add button on property sheets in mfc in winc

when i add button on property sheets in mfc it working properly but when i load to device its crashing.i am working on winc.any clue:(? ...

How can I make a CMFCRibbonEdit automatically convert contents to uppercase?

I am using the MFC Feature pack in Visual Studio 2008. I have an edit box (CMFCRibbonEdit) in a ribbon that I would like only to contain uppercase letters. I know that I can pass ES_UPPERCASE to the "Create" method, however "Create" is called from the Ribbon itself, and not explicitly by my code. To add the edit box to my ribbon, I call...

Application GUI development platform

Coming from C++ & MFC background, is there any better (maintainability/customization) platform in developing application GUI ? We are developing industrial applications (machine vision), where : -Performance-critical (mostly image processing in CPU atm, but GPU is up next) -Low level hardware interfacing (inhouse PCI device, frame gr...

asio::io_service hangs on destruction

Hello, i have timer implemented with boost (144 -> newest lib). This timer is started within a boos thread. The timer also starts a thread in which an io_service hosts deadline timer until thread is terminated. so a continuous timer. The boost thread which needs the timer is create from within DLL. The DLL ExitInstance function is call...

using boost string algorithm with MFC CString to check for the end of a string

I need to check whether my CString object in MFC ends with a specific string. I know that boost::algorithm has many functions meant for string manipulation and that in the header boost/algorithm/string/predicate.hpp could it be used for that purpose. I usually use this library with std::string. Do you know a convenient way to use this ...

Custom back ground for owner drawn menu

Im using mfc to draw a custom menu except it has a nasty looking border around it. How do i get rid of the border or draw over it? ...

how to raise resize request to active-x container?

We have an active-x control developed using ATL with MFC support. Our active-x control shall be used in something called frame application. The frame application create its own active-x control and embed our active-x control inside it at runtime. There are 20+ frame applications in the industry. Now the issue is that each frame applicat...

Menu for MFC application

Hi, I am new to MFC programming. My application is an OpenGL based game using MFC. I have completed the graphics part of the app, but is stuck at adding a landing menu for my game. How does one add different dialog to an MFC application? Regards, Aibin ...

how to increase thickness of slider conrol in mfc?

how to increase thickness of slider conrol in mfc ...

Unable to link afx_msg in BEGIN_MESSAGE_MAP

Hi, I'm trying to hook into the OnSysCommand function but I'm getting a confusing error. In the header, I am declaring the function like: afx_msg void OnSysCommand(UINT nID, LPARAM lParam ); And in the cpp the code is: BEGIN_MESSAGE_MAP(CMFCTest1App, CWinAppEx) ON_COMMAND(ID_APP_ABOUT, &CMFCTest1App::OnAppAbout) // Standard file b...