I have an application with a CRichEditView, and I'd like to find text in it. By creating a menu item "Find" with ID_EDIT_FIND, the view opens the find window and text is found by highlighting. BUT... the view is not scrolled, so if a text is found 100 lines below visible, that's where it stays. Ideas on how to make the control autoscroll...
Background: I'd like to make use of Electric Fence in an MFC application. I'd like to track new/delete, and if I can track malloc/free that's an added bonus.
Unfortunately, MFC redefines new and delete - but using macros (DEBUG_NEW) - so I can't use the standard C++ method of redefining them. (MFC defines them to have different signatur...
Using Visual Studio 2005, the debugger tells me that a deadlock has occurred just after startup of the app I'm writing - I'm well in to WinMain() at this point. The callstack shows that we are in a critical section, while calling AFX_MANAGE_STATE2 (for the 666th time, spookily enough) from within an MFC DLL. This has just started happe...
I have just finished my first real commercial application written in C++ / MFC.
The application consisted of agent installed on users workstations which in turn was controlled from a GUI Application on an administrators workstation. I choose C++ / MFC for these reasons.
Because I didn't know C#
Because I was not sure how long it w...
We need to deploy Visual C++ library. We have tried deploy this libraries using Merge Modules, but uninstall became too slow (about 10-20 minutes). So we've decided to deploy this libraries using XCopy method. Does anybody know any troubles with deploying Visual C++ library using XCopy?
...
I have an application with following windows hierarchy:
W1
-W2 (Child of W1)
- W3 ( Child of W2)
--------------------|
| W1|------------| |
| |W2 |------| | |
| | |W3 | | |
| | |------| | |
| |------------| |
|-------------------|
When certain event happens in W2, I call UpdateWindow:
W2::onCertainEvent()...
I am trying to get a context menu to work for a CListCtrl derived class. I just created a method OnContextMenu, but it isn't being called. What am I missing? I am using Visual Studio 2008, to create a CDialog based MFC application.
customlist.h
class tcCustomListCtl : public CListCtl
{
DECLARE_DYNAMIC(tcCustomListCtl)
public:...
I find this situation comes up from time to time, and I never seem to have a really robust generic solution to it.
I have a control - in this example an EDIT control on a dialog. I want to take certain actions in response to the user - and only the user - modifying the contents of the edit control.
The edit control can be set programm...
Scenario: I would like a window control which is a sub-window in my dialog (a subwindow of a subwindow) to propagate its notification messages out to the dialog window.
e.g. A COMBOBOX contains an EDIT control. I have a circumstance where I would really like to know when the EDIT field gains and loses focus (mainly because the stupid CO...
I am trying to create a GUI to display information read from a file. So I will need some number of pushbuttons, text fields, and radio buttons - but I won't know how many I need until run-time.
I am using Visual Studio 6.0. My toolset is fairly non-negotiable, so please refrain from suggesting Java, or any C++ toolkit that does not co...
I have to open up a external program in my MFC application, which works but if I have already clicked button, I don't want it to open another instance but just bring it to front. The docs say the SW_SHOWNORMAL parameter does this, but it is not working for me. Does the called program have to setup for this also?
ShellExecute(NULL, "op...
I have a recurring problem with a statically linked library I've written (or in some cases, code was accumulated from open sources).
This library, MFC Toolbox Library by name, has a lot of free functions, classes, and so on which support MFC programming, Win32 API programming, as well as the venerable C-library and newer C++ standard li...
THere are a lot of wrappers for toolkits like Qt, Cocoa or WxWidgets for D, Python, Ruby and other languages.
I wonder if anyone has ever written a binding for MFC ?
...
Hi!
This is my first my MFC application, and unfortunately i don't understand, how it works. I found a simple MFC application, which gets the file list of a given path. I modifyed this code for my needs, but now i have one problem. What my application should do is the following. It reads two drive letters from a file. Then gets the file...
You have to call this before using CRichEditCtrl in a MFC C++ application, and one obvious way is to put it in the application startup code.
However I was thinking about including it in a custom control which subclasses CRichEditCtrl, so that an application doesn't have to remember to make this change.
Is there any potential reason cal...
In MyControl.h I have:
class CMyControl: public CRichEditCtrl
{
DECLARE_DYNAMIC( CMyControl)
public:
CMyControl();
virtual ~CMyControl();
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMyControl)
//}}AFX_VIRTUAL
// Generated message map functions
protected:
//{...
I am working on a class derived from CRichEditCtrl. I want an instance of my class to know:
Update: solved it now.
when it has been Created (i.e the HWND is non-null)
when it gains/loses focus
when the text changes
when the selection changes
when a right-click has happened (I'm guessing through EN_MSGFILTER)
For 1, I found that over...
I'm maintaining an MFC/COM/ATL 45-odd project solution originally written with VS6. I'm now using VS2008.
I'm looking at a list control(vanilla CListCtrl) which doesn't behave as we think it should.
Normally in an MFC list control you can press a key, (Q say) & selection will jump down to the 1st line beginning with 'Q' (like windows ex...
I currently have NM_CUSTOMDRAW message calling a function to color the rows of a listctrl in report mode. I can detect when a row is selected and color it myself, but this method doesn't get called for the cell that is selected, so I can't color that cell. So my question is 1) is there a way to have windows call my custom draw method f...
It has methods like CRichEditCtrl::Copy(), CRichEditCtrl::Paste() which you can call, but I can't spot any messages the control is sent by Windows telling it to perform a paste operation. Does anyone know if such a thing exists? Or does CRichEditCtrl do something lower-level like monitoring WM_CHAR events? If so can I reuse any internal ...