mfc

MFC dialog buttons show up as black boxes

I have an old MFC utility written with VS2008 project. We have used this utility for a few years now and I have never experienced this problem personalty but it is showing up more and more often on customers computers. Sub dialogs launched from my main dialog will have their buttons blackened out. I have included a screenshot from one ...

Fetching CBitmap out of CImageList

I inserted bitmaps in CImageList in one Function and needed to change some of the images later in another function. But I am unable to extract the CBitmap. The code goes something like this: CBitmap GetIndividualBitmap(CImageList oImgList, int nBmpNo) { IMAGEINFO imgInfo; imagelist.GetImageInfo(index,imgInfo); CBitmap bmp; bmp.FromHan...

wrapping MFC application(target mobile device) to create dll for use in c#.NET for interop

Hi All, I have an MFC application to run on mobile device. Now this appliation code need to be reused from C#. I am trying to create wrappers, dll, and import this dll from c#. Problem being faced is , my project is not a class library. So i created another MFC class library - (MFC-Shared dll) in the same solution and tried to create ...

EN_MSGFILTER, can't prevent message propogation

I have a dialog with a rich-text control. The dialog wants to intercept right-click events on the control; in some cases the dialog should do its own functionality and block the message reaching the control, in other cases it should let the control receive the message. So I have: ON_NOTIFY(EN_MSGFILTER, IDC_RICHTEXT, OnRichTextMsgfilte...

Compile time error C4407.

Hi All, We have the following class structure in our code Class A: public CDialog, public Base1, public Base2 { }; In implementation of Class A we have the following: BEGIN_MESSAGE_MAP( A, CDialog ) ON_WM_SIZE() END_MESSAGE_MAP() Please note Base1 and Base2 doesn't inherit from CDialog or any other MFC classes. On VC6 the com...

"Nobody should be using MFC any more" Why?

Is it true that "Nobody should be using MFC any more" And why is that? ...

Changing the color of a selected CTreeCtrl item?

(VS2008, MFC, feature-pack) Using a CTreeCtrl, I need to have the selected item "better" highlighted when the control looses focus. My Tree is created with the "TVS_SHOWSELALWAYS" option in the resource editor, but the color is not visible enough. I already have code to change the items colors via the custom draw message (NM_CUSTOMDRA...

Can a window be "in between" minimized (or maximized) and restored state?

I am wondering what state a window is in during the action of minimize maximize or restore. I am not actually sure if this question even makes sense - I am quite new to win32 programming. Basically I have an app with a timing problem where it doesn't see an office app window as visible (IsWindowVisible call) when it is in the process of...

What are good resources to learn about creating a custom WS_CAPTION style for Windows 7?

I want to learn more about creating my own, custom WS_CAPTION style, the end of which would allow me to build a custom CMainFrame for my application that will respond appropriately to Windows 7 drag events. Any books, web sites, etc that people recommend for learning this kind of thing? ...

How to show a MFC dialog without stealing focus on the other window.

I have the dialog shown with ShowWindow(hWnd, SW_SHOWNOACTIVATE); But it doesn't work, the new dialog still steals the focus, why is it? here is the some code snippets from my program, QueryWindow is the MFC dialog class linked with the dialog: QueryWindow window; //window.DoModal(); window.Create(QueryWindow::IDD); window.ShowWindow(S...

Not receiving WM_QUERYENDSESSION when minimized to system tray.

I'm trying to catch WM_QUERYENDSESSION to save some data in the app, but it seems that I'm not receiving this message on User logoff/system restart when the app is minimized to the system tray. How can I catch it? Thanks. Relevant code (nothing magic in there, hopefully :)): ON_WM_QUERYENDSESSION() BOOL CMainFrame::OnQueryEndSession(...

WinCE MFC checking for SIM card existen?

Hi, Is it possible to use WinCE MFC application to check if SIM card presents in device or not? thanks. ...

Common Controls 6.0 in Windows 2000?

I'm wanting to use Grouping in CListCtrls, which seems to have been introduced in Common Controls 6. CC6 only came out with XP, so we have a problem with Windows 2000 and earlier. Deploying a new version of Comctl32.dll would seem to be the solution - however, our software has the requirement of being a standalone executable. Is there a...

Link error: unresolved operator << for std::basic_ostream with CStringT

I just reorganized some libraries of my Visual C++ (7.1) project and got trouble with the linker i cannot resolve. The Project links MFC as well as Standard Windows Libraries, all MBCS Somewhere, there is something like : std::stringstream sstr; sstr << m_MyCStringVar << std::endl; (this line, as well as some others, needs << for ba...

How does visual studio associate mfc dialog classes with dialog resources?

Hello, I was wondering how visual studio associates mfc CDialog derived classes with their corresponding dialog resources. I'm not interested in how the connection is made at run time (as asked here), but rather at design time. When I add a message handler to a dialog, how does it know which class to add the handler to. Also, is it pos...

Making non pop-up window transparent in mfc

Can i make a non popup window transparent and also ensure the child windows are not transparent? Also i have to block click through by transparent window? ...

Are multiline tooltips possible using CWnd::EnableTooltips()?

I'm attempting to make my tooltips multiline, but I don't seem to be having much luck with it. I call CWnd::EnableTooltips() directly after creation (in this case, an edit box) and I handle the TTN_NEEDTEXT message. My tooltips display correctly, but only display as a single line. I've tried adding '\n' to the string I pass when han...

How to replace window desktop with my own application window CWnd

I tried to paint on my windows desktop using GetDesktopWindow(). But i failed because desktop repaints itself rapidly and my painting doesn't appear. So I need to replace my desktop window obtained by GetDesktopWindow() with ownerdraw application window Can anyone has an idea, how to do this ? Thanks in advance, Milan ...

QTextEdit (QT Control) alternative for MFC Application?

Hello Do you know any (paid or free) MFC control with features like (QT) QTextEdit control? Good HTML (and may be RTF) support (import, export) Ability to edit manual control content :) ...

button keyboard focus issues

How would one prevent the little dotted square that appears on a button when it has the keyboard focus in a dialog. (w/ apologies for the technical jargon). At one point I hacked together a solution by subclassing a button WindowProc and subverting some windows messages, but wanted to know the correct way. There's actually a problem ...