mfc

Where is a good place to start programming GUIs for windows?

I have experience writing console and network client/server apps in C and C++, but I know next to nothing about using the win32 visual API, MFC, QT, WxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?...

How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown?

In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes. How can I keep the mouse cursor from being hidden? ...

Performance critical GUI application (windows,linux)

All, I've been tasked with updating a series of applications which are performance critical VB.NET apps that essentially just monitor and return networking statistics. I've only got three requirements: convert it to C#, make it fast, and make it stable One caveat is that we "may" migrate from a .NET platform to linux "soon" I will be ...

Removing icon from Windows title bars without ditching close button or system menu?

Hi! I'm developing an MFC application and I've recently been searching for a good method to remove the icon from a Windows title bar, but retain the close button. The two obvious candidate solutions are turning off the system menu style or using the tool window style, but I would prefer not to disable the system menu or use the shrunken ...

Best way to connect To Sql Server with MFC

Soooo, I am starting this new job soon where most of the code is legacy MFC. The end goal is to convert/rewrite to C#. I'm a little rusty with MFC so writing some code so I can try and spark my memory. Anyway, was wondering the best way to connect to a SS2005 database with MFC. Back in the day CDatabase via ODBC was the way to go, has t...

Future proofing a large UI Application - MFC with 2008 Feature pack, or C# and Winforms?

My company has developed a long standing product using MFC in Visual C++ as the defacto standard for UI development. Our codebase contains ALOT of legacy/archaic code which must be kept operational. Some of this code is older than me (originally written in the late 70s) and some members of our team are still on Visual Studio 6. However,...

How to host a WPF form in a MFC application

I'm looking for any resources on hosting a WPF form within an existing MFC application. Can anyone point me in the right direction on how to do this? Thanks, --Mark ...

How can an MFC application terminate itself?

What is the proper way for an MFC application to cleanly close itself? ...

What's the simplest way to execute a query in Visual C++

I'm using Visual C++ 2005 and would like to know the simplest way to connect to a MS SQL Server and execute a query. I'm looking for something as simple as ADO.NET's SqlCommand class with it's ExecuteNonQuery(), ExecuteScalar() and ExecuteReader(). Sigh offered an answer using CDatabase and ODBC. Can anybody demonstrate how it would b...

How to enable the TRACE macro in Release mode?

The TRACE macro can be used to output diagnostic messages to the debugger when the code is compiled in Debug mode. I need the same messages while in Release mode. Is there a way to achieve this? (Please do not waste your time discussing why I should not be using TRACE in Release mode :-) ...

Integrating Qt into legacy MFC applications

Hi, We currently maintain a suit of MFC applications that are fairly well designed, however the user interface is beginning to look tired and a lot of the code is in need quite a bit of refactoring to tidy up some duplication and/or performance problems. We make use of quite a few custom controls that handle all their own drawing (all ...

MFC resources / links

I am about to reenter the MFC world after years away for a new job. What resources to people recommend for refreshing the memory? I have been doing mainly C# recently. Also any MFC centric websites or blogs that people recommend? ...

How Can I Monitor Which Window Currently Has Keyboard Focus

Is there a way to track which window currently has keyboard focus. I could handle WM_SETFOCUS for every window but I'm wondering if there's an alternative, simpler method (i.e. a single message handler somewhere). I could use OnIdle() in MFC and call GetFocus() but that seems a little hacky. ...

MFC: MessageBox during a Drag-Drop

I need to display an error message on rejecting a drop in my application. I tried this in the OnDrop() but then the source application hangs till my message box is dismissed. How? ...

64 bit tools like BoundsChecker & Purify

For many years I have used two great tools BoundsChecker & Purify, but the developers of these applications have let me down, they no longer put effort into maintaining them or developing them. We have corporate accounts with both companies, and they both tell me that they have no intention of producing versions to support 64 bit applica...

How to create a non-interactive window in MFC

In my application I have a window which I popup with small messages on it (think similar to tooltip). This window uses the layered attributes to draw alpha backgrounds etc. If I have several of these windows open at once, and I click one with my mouse, when they disappear they cause my application to lose focus (it switches focus to the...

Lightbox style dialogs in MFC App

Has anyone implemented Lightbox style background dimming on a modal dialog box in a MFC/non .net app. I think the procedure would have to be something like: steps: Get dialog parent HWND or CWnd* Get the rect of the parent window and draw an overlay with a translucency over that window allow the dialog to do it's modal draw rou...

Do you know of a good program for editing/translating resource (.rc) files?

I'm building a C++/MFC program in a multilingual environment. I have one main (national) language and three international languages. Every time I add a feature to the program I have to keep the international languages up-to-date with the national one. The resource editor in Visual Studio is not very helpful because I frequently end up le...

regex for parsing resource (.rc) files

Ulimately I just wanted to extract strings from the .rc file so I could translate them, but anything that goes with .rc files works for me. ...

Reading VC++ CArchive Binary Format (or Java reading (CObArray))

Is there any clear documentation on the binary formats used to serialize the various MFC data structures? I've been able to view some of my own classes in a hex editor and use Java's ByteBuffer class to read them in (with automatic endianness conversions, etc). However, I am currently running into issues while trying to bring over the ...