mfc

In Memory INI File Writer

Hello, I have an MFC app which is wizard based. The App asks a user a variable number of questions which are then written to an INI file which is later encrypted when the user clicks Finish. All the INI file parsers I have seen so far seen read or write to a physical file on Disk. I don't want to do this as the INI file contains con...

How do you disable the Maximize button in MFC?

How do you disable the Maximize button/capability in an SDI application? ...

Win32 Message Pump vs MFC Message Maps, which is faster? C++

not from the ease of use, but from the performance point of view. are MFC message maps faster than a typical message pump? ...

a Process hidden from the Process Monitor

Hello, I need to create an application which will be reading and writing to files(C++/MFC). but I need the process not to appear in process monitor (which comes with SysInternals). From the reactions of others, I now confirm that this seems "illegal". but that is the request of the client I'm dealing with. so, I guess I just have to sa...

How can I transform a string into an abbreviated form?

I want to fit strings into a specific width. Example, "Hello world" -> "...world", "Hello...", "He...rld". Do you know where I can find code for that? It's a neat trick, very useful for representing information, and I'd like to add it in my applications (of course). Edit: Sorry, I forgot to mention the Font part. Not just for fixed widt...

Compiling MFC application with /clr (step1: linking against dynamic DLLs)

I have successfully upgraded an MFC application which was compiled with an old version of Developer Studio to Visual Studio 2008. A very small number of changes were needed because of some breaking changes in MFC. Now that everything works, I'd like to take the next step and compile the solution with /clr. To do so, I have found useful ...

How to know if code is running on the ui thread or a working thread (MFC Visual C++)

I have a function that is being called from different threads in the application. I need to know whether the thread that executes the code is the main thread(ui thread) or a working thread. Any suggestion? Thanks. ...

Disallowing creation of the temporary objects

While debugging crash in a multithreaded application I finally located the problem in this statement: CSingleLock(&m_criticalSection, TRUE); Notice that it is creating an unnamed object of CSingleLock class and hence the critical section object gets unlocked immediately after this statement. This is obviously not what the coder wanted...

Map plugin for an MFC application

I want to display a map in a MFC application (Visual Studo 2008 with MFC Feature Pack). Off the top of my head I have the following requirements: I have to be able to add my own markers (plain lat/lon positions), preferrably with different colors/icons so one can distinguish between different types of markers. If the map data is fetche...

Recursive file search using C++ MFC?

What is the cleanest way to recursively search for files using C++ and MFC? EDIT: Do any of these solutions offer the ability to use multiple filters through one pass? I guess with CFileFind I could filter on *.* and then write custom code to further filter into different file types. Does anything offer built-in multiple filters (ie. ...

Changing the Total Number of Recent Files

I'd like the user to be able to edit the number of recent files shown in the File menu of my MFC application. I've used two very good references: http://www.codeproject.com/KB/menus/changemru.aspx http://www.microsoft.com/msj/0899/c/c0899.aspx It involves deleting and recreating the CRecentFileList object stored in CWinApp::m_pRecen...

How can I check if a combobox is a dropdown or a dropdownlist

Is there a way to retrieve the type of a CComboBox? I need to know if it is a "Dropdown" or a "Drop List". I've tried the following: if (m_MyComboBox.GetStyle() & CBS_DROPDOWN) // do some stuff and if (m_MyComboBox.GetStyle() & CBS_DROPDOWNLIST) // do some stuff But both expressions seem to evaluate to TRUE regardless of the ...

std::multimap compile errors

I am trying to use multimap for the first time but my app will not compile. TIA Paul.. // file dept.h typedef std::multimap <CString, std::map< CString, CString> > _DeparmentRecord; // also tryied replacing CString with LPCWSTR _DeparmentRecord DeparmentRecord; // file dept.cpp DWORD CIni::AddNameValue(LPCWSTR Section, LPCWSTR Nam...

URL escaping MFC strings

How do you URL escape an MFC CString? ...

Strange behavior with the hotkeys in VC++

I have a dialog written in VC++ as shown below: Label1 Control1 Button1 If Control1 is disabled, using Label1's hotkey results in Button1's Click event. How could I avoid that? As Control1 is disabled shouldn't the hotkey for Label1 too? ...

Having trouble enabling verticle scrolling in edit box

I'm using Visual Studio 2005 and programming a dialog-based MFC application in C++. I have an edit box and I'm trying to make it auto-scroll. When I make auto vscroll true, it still won't auto-scroll when I have too many lines in my edit box. Any ideas in what could be wrong? Is there maybe some code line I have to add to my edit box? ...

Need help adding scroll bar to edit box

I'm making an MFC dialog-based application in Visual C++ 2005. I added a scroll bar to an edit box. How do I program the scroll bar to make it work? ...

Why do my radio buttons not work?

I'm working on an MFC dialog application in Visual C++ 2005. My radio buttons are m_Small, m_Medium, and m_Large. None of them display what they are supposed to in my m_Summary edit box. What could be wrong? Here's my code. // Pizza_ProgramDlg.cpp : implementation file // #include "stdafx.h" #include "Pizza_Program.h" #include "Pi...

ListView Control with paging capabilities

I am looking for a control similar to the one used in FeedDemon 2.7. it's a ListView with paging capabilities. it divides contents into pages. at the bottom of the control, you can see Page 1 of 3 and so on. you can see what I mean at the bottom of the attached picture : Page 1 of 3 . I hope you understand what I mean. Thanks. ...

Supporting different monitor resolutions

I have a MFC application with some bitmaps, dialog boxes and menus. Currently it supports only one monitor resolution (1280x1024). I am planning to add different monitor resolution support to it. To do that I guess I have to load different resolution bitmaps, change the font size etc. My question is, how these are handled in a typical wi...