that's not usually true - you can't undo an undo - when you do the first undo, the stack is emptied
Mister Transistor
Posts
-
an interview question of undo/redo -
MFC CString QuestionI assume you mean strString.MakeReverse(); this method reverses the string internally, you don't set a new string equal to it.
-
MFC splitter window view linkageHi, I'm building an MFC app (not everyone has moved to .NET yet, in fact I have decided to skip .NET and wait for the next framework, due any time now)that has a splitter window with two main panes, left and right. In each pane I have a tab control. The left tab control has a tree control in each tab. The right tab control will have different controls in each tab, depending upon the selection in the left tab control's selected tree and item. That's all fairly specific, but my question is quite general. What is the best way to cause events in one pane of a splitter (in the case selecting a treeitem) to make things happen in another pane. In a more simple example, how would events in the left view cause changes to the right view? I ask this because normally views do not know about each other, only about their parent frame. What's the most elegant way to link the views? (NB, I'm not asking what are the tree notification events, I know those).
-
GetDocument in a dialog?that's very interesting thank you ... I think you mean pDoc = pLeftView->GetDocument(); I'll try that shortly. Thanks again. Andrew
-
ClassWizard missing classes?John, thanks very much, deleting the .clw file and rebuilding the ClassWizard data did the trick. regards Andrew
-
ClassWizard missing classes?It seems to happen quite frequently in my MFC projects that the dropdown list in ClassWizard has only a subset of the classes in the project, for example if I have multiple Views, most of them are missing. The ClassView of VC6 shows all of them correctly. This makes it a pain to add message handlers etc, although I can do it by right-clicking on the ClassView. Does anyone understand this - is it a bug or a feature? Can I fix it? thanks for any help.
-
GetDocument in a dialog?I have an MFC app and I want to use a dialog to filter data in the document. But how do I get hold of GetDocument()? All I can find that almost works is to use in OnInitDialog CTransistDoc* pDoc = (CTransistDoc*) CLeftPaneView::GetDocument(); ie I try to get it via my View, but this fails with error C2352: 'CView::GetDocument' : illegal call of non-static member function Which seems to be saying that OnInitDialog() is a static function. It is declared normally virtual BOOL OnInitDialog(); How do I sort this out? And where is this kind of nonsense explained? Thanks in advance for any help.
-
problem with trivial MFC appGary, thanks - that has indeed fixed it. You don't by chance know a good book/article that explains the principles of MFC programming rather than just showing which menus to click? cheers Andrew
-
problem with trivial MFC appAs testing for a real MFC application I made a trivial one, but ran in to problems. To my mind this exemplifies the difficulties faced by the newbie to MFC and doc/view. I wanted a single-window MFC doc/view app with a static control on the window. I used AppWizard to make an MFC EXE. It ran and showed an empty window. I put my static control in the view .h file private: CStatic Statcontrol; Now I made my ..Create() in the view .cpp file RECT rect = {100,100,200,200}; Statcontrol.Create("hello",WS_CHILD | WS_VISIBLE | SS_CENTER,rect,this,ID_STAT); But where do I put this code? In the view constructor it fails. In PreCreateWindow() it fails. All I get is a FALSE return - not much diagnostics. (But I guess 'this' is wrong). In the OnDraw() handler it works! But then it's called multiple times. Help! Why is something so simple so difficult? MFC books never help with things like this. Andrew MisterTransistor - germanium is King
-
Q about CProgressCtrlI have a simple problem with MFC and VS6 - I want to display a progress bar whilst I'm loading a lot of data. The load happens in a method of my class, which is created under the application's document class. My simple question is - how do I get hold of the parent window needed to create the CProgressCtrl? Can I use GetFocus() somehow? cheers Andrew