mfc

MFC IE embedded web browser wackiness

I have this modeless MFC dialog which embeds an Internet Explorer web browser control. The control is derived straight from CWnd with ActiveX wrappers generated by Visual Studio, and I map it to the CDialog using only a "DDX_Control(pDX, IDC_EXPLORER, m_explorer);" I have 2 problems. Problem #1: Being modeless, I start and stop the di...

Programmatically change combobox

I need to update a combobox with a new value so it changes the reflected text in it. The cleanest way to do this is after the combobox has been initialised and with a message. So I am trying to craft a postmessage to the hwnd that contains the combobox. So if I want to send a message to it, changing the currently selected item to the n...

App does not run with VS 2008 SP1 DLLs, previous version works with RTM versions

Since our switch from Visual Studio 6 to Visual Studio 2008, we've been using the MFC90.dll and msvc[pr]90.dlls along with the manifest files in a private side-by-side configuration so as to not worry about versions or installing them to the system. Pre-SP1, this was working fine (and still works fine on our developer machines). Now tha...

How do I display dynamic text at the mouse cursor via C++/MFC in a Win32 application.

I would like to be able to display some dynamic text at the mouse cursor location in a win32 app, for instance to give an X,Y coordinate that would move with the cursor as though attached. I can do this during a mousemove event using a TextOut() call for the window at the mouse coordinates and invalidate a rectange around a stored la...

Icons on menus of MFC Feature Pack classes

There are three places where menus show up in the new MFC functionality (Feature Pack): In menu bars (CMFCMenuBar) In popup menus (CMFCPopupMenu) In the 'dropdown menu' version of CMFCButton I want to put icons (high-color and with transparancy) in the menus in all of them. I have found CFrameWndEx::OnDrawMenuImage() which I can use ...

Migrating from Stingray Objective Toolkit

We have a collection of commercial MFC/C++ applications which we sell using Stingray Objective Toolkit, we have source code license and have ported it in the past to Solaris/IRIX/HP-UX/AIX using Bristol Technologies WindU (Windows API on UNIX, including MFC). Any long story short recently about 18 months ago we ported Stingray to Win64...

Can you use CMFCVisualManager with a dialog based application?

Can you use CMFCVisualManager with a dialog based application to change the applications appearance? If so how is it done? The idea is to change the shape, colour etc. of controls such as push buttons using the MFC Feature Pack released with MSVC 2008. ...

Programmatically select an MFC radio button

When I'm initializing a dialog, I'd like to select one of the radio buttons on the form. I don't see a way to associate a Control variable using the Class Wizard, like you would typically do with CButtons, CComboBoxes, etc... Further, it doesn't like a CRadioButton class even exists. How can I select one of the several radio buttons? ...

How to fix an MFC Painting Glitch?

Hello. I'm trying to implement some drag and drop functionality for a material system being developed at my work. Part of this system includes a 'Material Library' which acts as a repository, divided into groups, of saved materials on the user's hard drive. As part of some UI polish, I was hoping to implement a 'highlight' type feature....

Chart controls for MFC application?

I would like to have some suggestions about which third-part controls can we use in our Visual C++ MFC application? ...

Does the VFW (Video For Windows) API support Alpha Channel Transparency?

Does the VFW (Video For Windows) API support Alpha Channel Transparency? I want to be able to export video with Alpha channel information. How can I do this in VC6? ...

Screen capture doesn't work on MFC application in Vista

We've got some in-house applications built in MFC, with OpenGL drawing routines. They all use the same code to draw on the screen and either print the screen or save it to a JPEG file. Everything's been working fine in Windows XP, and I need to find a way to make them work on Vista. In three of our applications, everything works. In ...

Problem with TVN_SELCHANGED on CTreeCtrl object

I have tree control object created using CTreeCtrl MFC class. The tree control needs to support rename. When I left click on any of item in Tree the TVN_SELCHANGED event is called from which I can get the selected item of the tree as below : HTREEITEM h = m_moveListTree.GetSelectedItem(); CString s = m_moveListTree.GetItemText(h); H...

How do I reserve caret position in CEdit control?

I'm programming an application in MFC (don't ask) and I have a CEdit box that holds a number. When that number is edited, I would like to act on the change, and then replace the caret where it was before I acted on the change - if the user was just before the "." in "35.40", I would like it to still be placed before the dot if they chan...

How do you detect dialup, broadband or wireless Internet connections in C++ for Windows?

I have an installation program (just a regular C++ MFC program, not Windows Installer based) that needs to set some registry values based on the type of Internet connection: broadband, dialup, and/or wireless. Right now this information is being determined by asking a series of yes or no questions. The problem is that the person doing ...

interacting with a CMutex without MFC

We have multiple MFC apps, which use CMutex( false, "blah" ), where "blah" allows the mutex to work across process boundaries. One of these apps was re-written without MFC (using Qt instead). How can I simulate the CMutex using Win32 calls? (Qt's QMutex is not inter-process.) I prefer not to modify the MFC apps. ...

How to draw in the nonclient area?

I'd like to be able to do some drawing to the right of the menu bar, in the nonclient area of a window. Is this possible, using C++ / MFC? ...

How do I use the softkeys with a CDialog based application in windows mobile 6 via MFC?

How do I use the softkeys with a CDialog based application in windows mobile 6 via MFC? I have a CDialog based Windows Mobile 6 (touchscreen) Professional app that I am workign on. The default behavior of a CDialog based app in WM6 Professional is to not use any softkeys by default... I want to map the softkeys to "Cancel" and "OK" fun...

Unit testing MFC UI applications?

How do you unit test a large MFC UI application? We have a few large MFC applications that have been in development for many years, we use some standard automated QA tools to run basic scripts to check fundamentals, file open etc. These are run by the QA group post the daily build. But we would like to introduce procedures such that in...

Whats the best Ribbon UI control to retro fit to a legacy MFC application build with VC2005?

What experience have you had with introducing a Ribbon style control to legacy MFC applications? I know it exists in the new VC2008 Feature Pack, but changing compilers from VC2005 is a big deal for our source base and integration to our environment, Intel FORTRAN, ClearCase, many 3rd libraries. There are quiet a few different commeri...