mfc

MFC Wizard Appearance

I have a MFC wizard based application (CPropertySheet, CPropertyPage) created with vS2008. I am trying to give my app which is nearly completed a more modern look. I looked into CDHTMLDIalog but it looks like a lot of work and not too well documented. Next I thought I could use some of the features of the Feature Pack. I found a threa...

Display context menu over MFC application mainframe menubar

I have VC++ MFC app and I need to display a context menu over CMainFrame menubar. I added a handler for WM_CONTEXTMENU in CMainFrame and I am able to display my context menu over the toolbar (also the window title) but the handle does not get invoked when I right click in the menubar ...

"Sticky" MFC popup menu

I currently have some toolbar buttons with a small arrow on the side (TBSTYLE_EX_DRAWDDARROWS) that, when clicked, result in a popup context menu being displayed under the button. This is done by constructing a custom popup menu and calling TrackPopupMenu. The client now wants to be able to select multiple options from the menu before ...

"Don't show this again" option in message boxes

In C++/MFC, what's the simplest way to show a message box with a "Don't show this again" option? In my case, I just want a simple MB_OK message box (one OK button). ...

MFC/C++ equivalent of VB's AppActivate

Hello, AppActivate seems to be what i need, I am fairly sure there must be an c++/mfc equivalent. Thanks. ...

How to implement IExplorerBrowser in MFC

Apparently, there's a fairly easy way to host Explorer in your app starting with Vista: http://www.codeproject.com/KB/vista/ExplorerBrowser.aspx However, that interface is only available starting with Vista. I see that there is another way to do it: "going all the way back to 95, but it requires more work - implement IExplorerBrowser a...

How can I calculate the client area of an MFC CDialog without displaying it?

How can I obtain the Window Rect of a CDialog which is based on a dialog template. The dialog is not and can not be visible ...

MFC : creating a hyperlink in a button

Hi All, Is there an easy way in MFC to add a hyperlink in a button? I've searched the net and they seem to offer complicated stuff. Thanks. ...

How to not discard a CDC path?

I draw some symbols, that belong to certain objects, into a device context and now want to be able to later test if the mouse cursor is above such a symbol. To do this, my plan was to first create a CDC path and use that to create a CRgn region object. pDC->BeginPath(); pDC->Ellipse(ellipse[0], ellipse[1], ellipse[2], ellipse[3]); // C...

Cant override CMemFile::GrowFile

I have a class derived from CMemFile called TempMemFile. I need to but cant override the Growfile method in TempMemFile. When I hand write the GrowFile method in my derived class (TempMemFile) it is never called and In class view when I Click on my TempMemFile > Properties > Overrides the Growfile and other methods are not listed her...

Choosing between WPF, wxWidgets, Win32 API and MFC

Imagine you are on Windows 7 and you have to write a GUI for a GRAPHIC application, (like a terrain editor, mesh viewer ..) which involves a great use of DirectX and OpenGL (so written in native C++). If your goal is a multi-platform software then you should go for wxWidgets, but imagine you're doing a Windows' only app...what would your...

How to determine if a file is in a removable drive or in the local drive

How do you determine if a file is on a removable drive or in the local drive in vc++? ...

How to find whether system has the font I needed in MFC?

I want to write the following function bool IsFontExistInSystem(const CString& fontStyle) const { } Is there any API in windows to do this? Many Thanks! ...

VC++-MFC : LoadLibrary returns invalid handle 0x10000000

Hi, I am unable to load my test.dll (in VC++ - MFC) using LoadLibrary() API. I get error code 126 (Module not found)using GetLastError(). By dependency walker I have come to know that my test.dll depends on "xerces-c_2_7.dll" and "Xalan-C_1_10.dll". These dlls were already present on the same path as the exe. Still I am getting the error...

Does MFC have a built in grid control?

First what I want: The ability to display a grid with multiple columns, each cell having a custom render callback. So you might use such a control to display your inventory in a game, or something like the behaviour in Google Chrome where it shows a grid of popular pages you visit. I've been playing with CListCtrl and while I can get cu...

MFC - change text color of a cstatic text control

Hi All, How do you change the text color of a CStatic text control? Is there a simple way other that using the CDC::SetTextColor? thanks... ...

CMemFile and Unicode

Am I right in thinking that the MFC class CMemFile is cannot be used to write unicode data to because it uses BYTE* which is defined as unsigned char BYTE? The line line that actually writes the data in CMemFile::Write is Memcpy((BYTE*)m_lpBuffer + m_nPosition, (BYTE*)lpBuf, nCount); and if so can I replace BYTE with wchar_t in my...

C++ MFC vs .NET?

My colleagues are using Visual Studio 2002 and uses the C++ MFC. I am developing in C #. It has not been any problems before, but now questioning our customers if we really should develop in different environments. My colleagues think (of course) that I should move to C++ MFC. I think that they can use .NET instead of MFC. Is there a...

Controls Are cut in MFC when changing display to 125% in windows 7

I have an MFC application. When running it on Windows 7 I realized that when changing the display percentage to meduium - 125%, I have a TextControl which is cut off (end of sentence doesn't appear.) How can I fix this? I could enlarge the size of the control on the dialog, but I'd rather do that via the code. My application is locali...

How does Windows identify non-Unicode applications?

I am building an MFC C++ application with "Use Unicode Character Set" selected in Visual Studio. I have UNICODE defined, my CStrings are 16-bit, I handle filenames with Japanese characters in them, etc. But, when I put Unicode strings containing Japanese characters in a CComboBox (using AddString), they show up as ?????. I'm running Wi...