mfc

Qt goes LGPL! On Windows, is it good enough to use instead of MFC?

I just read a story I was hoping to read since Nokia bought Trolltech. Qt is going LGPL in March! This is awesome news. Who uses Qt for Windows? Does it effectively replace something like MFC? Sure, I can RTFM (and to some degree I have)... but what do people USING Qt on a Windows platform think of it? I still do quite a bit of M...

How to know if a MFC message loop is already running?

Is there any way to know whether a MFC message loop is already running? EDIT: Context: A library (with event handling) needs to know whether its event filtering has to attach to an existing MFC message loop or create its own message loop: in case a main message loop already exists it must not create its own loop because it would be bloc...

Windows service to control access to a file in "All Users\Application Data"

Hi, Here is my situation: I have an application that use a configuration file. The configuration file applies to all users of the system and all users can make change to the configuration. I decided to put the configuration file in "All Users\Application Data" folder. The problem is that the file is writable only by the user who cr...

How do I set the owner of a FilterGraph renderer?

I have a CView which I would like to host a DirectShow renderer. I did not write the original code, I am simply cleaning up and moving the code to VS2005. This necessitated an upgrade of certain third party tools and so I'm trying to change the code a bit without having a full understanding of DX/DirectShow. The problem is that my app...

Visual Studio 2008 viewing dialog after breakpoint hit

I am building a C++ MFC application that creates modal dialog boxes, one at a time, while hiding the parent dialog. I wish to view the newly created modal dialogs when a breakpoint is hit when debugging in Visual Studio. However, anytime a breakpoint is hit, the contents of the dialog box are no longer rendered. The box simply goes white...

Convert from tagRECT/CRect to Gdiplus::Rect

What is the easiest way to convert a RECT struct (tagRECT) or a CRect to a Gdiplus::Rect? Gdiplus::Rect tmpRect(rect.top, rect.left, rect.Width(), rect.Height()); works but is a lot of typing. ...

[Visual C++ 6 - MFC] How can I get and set the 'read-only' property of an edit box?

How can I get and set the 'read-only' property of an edit box? ...

CListCtrl - how to enable multiple selection

Hi, I am creating a MFC application for Windows Mobile and don't know how to enable multiple selection for List Control (CListCtrl). In properties panel Single Selection is set to False but still can't select multiple items. Any idea? Thanks! ...

What API to use for adding HTTP client support in an existing MFC app?

I have recently been given a task to add the ability to interact with Web Map Services to an existing MFC application and I am in need of a client-side HTTP API. Based on my research, the leading candidates seem to be CAtlHttpClient and WinHTTP. I was curious to see if anyone had experiences they could share or opinions on which woul...

Modifying decorated names - VS6.0 to VS2005 migration

After a number of hours Googling, I think it's time to ask the experts. We have a legacy module (MS Visual C++ 6.0) that we are trying to port to VS 2005. A number of calling applications exist, so we're trying, if possible, to keep these backward-compatible. Code-wise, this turned out pretty straightforward and a few hours of develop...

How to get size and position of window caption buttons (minimise, restore, close)

Is there an API call to determine the size and position of window caption buttons? I'm trying to draw vista-style caption buttons onto an owner drawn window. I'm dealing with c/c++/mfc. Edit: Does anyone have a code example to draw the close button? ...

How up to date is OpenStep as a development Environment?

Long time ago, the Game Developer magazine published an article about ID Software and their DOOM game. In the article ID states that they used a NeXT Step machine for development with GNU GCC cross compiler. Quoting: By writing in ANSI C on NeXTStep, Id Software is able to develop and test in a true programmer’s environment. Th...

How can I get the value (string) of the current selection in a combobox?

How can I get the value (string) of the current selection in a combobox? (Not the integer index) ...

CTreeCtrl - getting an item position

Is there a way of getting the position (index) of an item in a CTreeCtrl? I am interested in the index of a node at its particular level. I was thinking to maintain the item positions within the item "data" field, but the problem is that my tree is sorted and I cannot predict the position an item will receive (well, only if I sort the...

How can you make an MFC application with an HTML view consistently accept drag-dropped files?

I'm trying to decipher CHtmlView's behaviour when files are dragged into the client area, so I've created a new MFC app and commented out the CHtmlView line that navigates to MSDN on startup. In my main frame, I've overridden CWnd::OnDropFiles() with a function that shows a message box, to see when WM_DROPFILES is sent. OnDropFiles() g...

The procedure entry point _wsplitpath_s could not be locating in the dynamic link library msvcrt.dll

Recently upgrade a MFC++ Project which includes .NET assemblies from Visual Studio 2005 to 2008. Now whenever its installed it displays the following message: The procedure entry point _wsplitpath _s could not be locating in the dynamic link library msvcrt.dll I've install Microsoft Visual C++ 2008 SP1 Redistributable Package (x8...

How to update common control in windows 2000 to version 6

How can I update the common control dlls to version 6 on windows 2000. I have built a MFC application using new features available in version 6 of windows common control. The default version of the dll in windows 2000 is 5.80. I need to support windows 2000, I am unable to find a way to update the common control dll. The Microsoft websit...

Cancel a DeferWindowPos

I am doing a series of window resizing using the DeferWindowPos functionality. Suppose I already opened the DeferWindowPos handle, and called DeferWindowPos a few time, and now I want to cancel everything: not call EndDeferWindowPos. I tried CloseHandle( hDWP ), but it does not work (crash). If I simply return from my function, I ass...

Memory consumption by CHtmlView MDI windows

I have found a problem with the MFC CHtmlView class in an MDI app. Repeatedly opening and closing windows causes a progressive drain on memory. I’ve researched the problem and found the MSDN article about the BSTR problem (http://support.microsoft.com/kb/241750), implemented those fixes, but there is still a large drain occurring. I’v...

Disable/Enable Ribbon Buttons for MFC Feature Pack

I am using the MFC Feature Pack and I have some buttons on a ribbon bar, instances of CMFCRibbonButton. The problem is that I would like to enable and disable some of them in certain conditions, but at runtime. How can I do this? because there is no specific method for this...I heard that a solution would be to attach/detach the event ha...