mfc

What is the fact of DirectUI ?

I am working on a windows desktop application which needs a great UI. I use Visual studio and MFC now. Then heard of DirectUI technology is a good solution, but I can not find some articles on "DirectUI". Can you give me some tech. points on "DirectUI" ? If it's possible to implement a DirectUI library for future use? Thanks. ...

Set text with two different colors in edit control

How to write text in a same edit control or rich edit control with two different color?? ...

Visual Studio Linking errors. MFC, CRT order?

This questiod had been brought up numerous times, but Visual Studio never gives up to challange me. We have an application that should be self sufficient, i.e not depend on any dlls. This is why we build everything statically with MT(d) code generation flags. The app depends on Qt, zlib, OpenSSL and DCMTK. All of them were built as sta...

How to access a global variable from a worker thread

I have a vc++ 2005 dialog based application, where I use a worker thread to do some background processing. The worker thread is implemented as a global function in the dialog class I am able to access the variables of the dialog class inside the worker thread but I am not able to get some of their their values correctly inside the wor...

Draw on DeviceContext from COLORREF[]

Hi, I have a pointer to a COLORREF buffer, something like: COLORREF* buf = new COLORREF[x*y]; A subroutine fills this buffer with color-information. Each COLORREF represents one pixel. Now I want to draw this buffer to a device context. My current approach works, but is pretty slow (== ~200ms per drawing, depending on the size of th...

Cannot compile with memory dump for some files

Hi, I use this Debug.h file that I include as the last #include of the files where I want to debug for memory leaks. Then using _CrtDumpMemoryLeaks(); to dump it to my output.. This works fine for most files, but when I include it in some files I get the error below. It looks like it got to do with the boost::unorderer_map<> .. but I ca...

Help using MFC CMap (or std::map) please.

Hi, a C++ noob here. I am trying to tweak some code, with the following key lines (meaning they are not the only ones, but they are the only ones that should matter for this question). By the way, I am using Visual Studio 2010 C++ compiler on Windows. CMap<ATL::CAtlString,LPCTSTR,UINT,UINT> mapForDuplicates; // "dict" definition ATL::CA...

How do I modify a MFC dialog member after it is created?

I used the Wizard to create a baisc input box with a OK and Cancel I made the input box type "int" with min value 0 and max 99. Now I want to edit the input box so that it is type string. I have the MFC ClassWizard open and can see the ControlID, Type, and Member ID of the input box. However, there is no option to edit it... How...

Maximized Window Restores to Full Screen

Using CWnd::ShowWindow(SW_SHOWMAXIMIZED) maximizes my app window as expected. However, when clicking the restore button on the app (or double clicking the title-bar), the restored size is the same size as the maximized window, which is confusing for the user. Using this alternative code has the same problem: WINDOWPLACEMENT wndpl; Get...

MySQL error 2005 (using MySql C++ Connector):

I am trying to connect to a database using MySQL C++ Connector. I have used this code segment many times: driver = get_driver_instance(); connection = driver->connect("tcp://127.0.0.1:3306", "user", "pass"); and it has worked successfully, but now I am getting this error thrown from this code segment: "Unknown MySQL server host 'ÇD$Œ...

Error after compiling .IDL file for Firefox accessibility

Hello everyone! I've encountered a very annoying problem while working with Firefox MSAA (). I tried to compile IDL file from cmd but it failed. Then I added it to the project and ran build. After VS compiled interface file there were two C files - ISimpleDOMDocument_h.h and ISimpleDOMDocument_i.c I added those to the project. But now I...

Making a c# winforms application useable as a dll from an unmanaged mfc application

I'm wondering how I would go about converting an existing c# winforms application to a class library and then call it from an mfc application. Are there any references on how to do this? I've tried googling, but, besides the fact that it will need the ComVisible attribute set to true I haven't found much information. Thanks. ...

Save a portion of my program’s own window to a bitmap file using mfc/win32.

Within my mfc program, I need to programmatically capture a portion of that program’s own window, then save it out as a file (bmp or jpg etc). How to do this without using 3rd party library? ...

how to draw a graph control in MFC VC++ Visual studio 2008 ?

Hi, I need to draw a graph which can be updated continuously on WinCE platform. For that, is there any built-in control available in MFC VC++ VS 2008 ? ...

how to change highlight color in list control in mfc

how to change highlight color in list control in mfc. i havn't found any api in clistctrl. i have override NM_CUSTOMDRAW as descripbed in msdn but when i clicked on any item on list it showing half blue color and half black color why blue is coming ? ...

Painting problem in CListBox

I have derived a class from CListBox. It has 10 items. But its size is of 20 items. To reduce flicker I have Overridden the OnEraseBackground method to return true. I have also Overridden DrawItem. The DrawItem is called only 10 times, once for each item. I want to color the remaining part of the list. Can anyone suggest the most ...

How to get notification on when richedit control has maximum text length

I want to increment the height of my edit control when size of string in richedit control gets maximum means to its width. I have used EN_MaxText but it is not working in RichEdit control. ...

How can I poll the SpaceNavigator 3D Mouse from MFC in Visual Studio 6

I have an MFC project in Visual Studio 6 and I am trying to poll the SpaceNavigator 3D mouse for angles and translation. The examples on the 3dconnexion website are for later versions of visual studio, and the archive and the ftp link referred to on the forums are outdated information. Where can I download a proper sdk for vs6? I have i...

How to begin with Microsoft Chart Controls in MFC

I'm creating an MFC application using V.C++ 6.0. I need to plot a graph between two parameters like Intensity(on X-Axis) & Count(on Y-Axis). Is there any good tutorial that explains using Microsoft Chart Controls in MFC. Please help me with this. ...

IMPLEMENT_DYNCREATE, "Use MFC in a Static Library" and inheritance

If I switch my project from using MFC in a shared DLL to use MFC in a static library, the following code won't compile: class Test : public CObject { public: //DECLARE_DYNCREATE(Test); // If I uncomment this line, it works }; class Test2 : public Test { public: DECLARE_DYNCREATE(Test2); }; IMPLEMENT_DYNCREATE(Test2, Test); // ...