OnSetActive not called

Hello NG,

I have an MDI app. The view has a property page. There I have OnSetActive
that calls a function "FillEditCtrl" to showsvalues in an edit control.
I call a menu that opens a dialog. The user can edit values that are shown
in the edit control of the property page of the view.
The user closes the dialog. But OnSetActive of my property page is not
called, so the values are not shown in my view.

After closing the dialog, what afx msg is called instead?

void CMainFrame::OnMenuEditValues()
{
   CWnd* pw = GetActiveWindow();

   CTheDialog dlg;
   dlg.DoModal();

    pw->SetActiveWindow();
}

I don't call the FillEditCtrl directly from CMainFrame, because the user can
open other docview-Windows (MDI)

How does the property page know, that it is active again after the dialog to
call FillEditCtrl?

Thanks for help,
Guido


0
Guido
6/30/2010 3:32:56 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
1378 Views

Similar Articles

[PageSpeed] 27

>I have an MDI app. The view has a property page. There I have OnSetActive
>that calls a function "FillEditCtrl" to showsvalues in an edit control.

That seems a mighty odd event to populate an edit control from!

>I call a menu that opens a dialog. The user can edit values that are shown
>in the edit control of the property page of the view.
>The user closes the dialog. But OnSetActive of my property page is not
>called, so the values are not shown in my view.

The correct way of getting things to update is to call UpdateAllViews
from your CDocument derived class.

Go with the flow of the MFC Doc/View - life will be simpler.

If you've not already done so, I recommend that you go through the MFC
scribble sample - that illustrates the fundamentals of using MFC
Doc/View.

Dave
0
David
6/30/2010 4:47:20 PM
Reply:

Similar Artilces:

Async calls to WebService in MFC
Hey guys, I use a webservice over the net which is scripted in VB.Net. This web service receives a username and a password and returns a string structure with multiples infos. If the string is empty, I had the wrong username and/or password. Pretty simple isn't? Ok now the problem is a bit more complex. I'm using an MFC client to connect to these web services, and since they're on the internet, there's a delay between sending the data and receiving an answer. I don't know really how I can tell me client to "wait for the string". The wrapper MFC created for the w...

Call a word doc
Currently I am using our DB to track bids to general contractors for building materials. Each bid proposal is prepared in MS Word. Is there a way to call a Word doc for reference only within a form, for example using a button? The proposal could be either a .doc or .pdf that could be reprinted or viewed from Access... -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/200802/1 Whoops, that was not complete. Each bid has its own word file. So when I click a button I need to be able to define the file name. We use a bid number formatted l...

Printing (order of calling methods)
Hello, I've got CmyView Class (derived from Cview). In one method in CmyView class there's line: CmyView.SendMessage(WM_COMMAND,ID_FILE_PRINT,0) My question is: What methods will be run, in what order and from which classes? (CmyView, or Cview) ? Thanks in advance Tom Dear Tom; In MFC C++ 6 -- ID_FILE_PRINT calls: // ...VC98\MFC\SRC\Viewprnt.cpp(line 131) void CView::OnFilePrint() I think this is some of the most complicated code that MFC allows us to implement. CView::OnFilePrint() then expects you to implement overrides for various functions that it exposes inside ::OnFilePrint(...

Calling a Procedure
I have two workbooks open - WB1 and WB2 (for simplicity). In WB1, I have a macro - Proc1 (arg1, arg2). In WB2, I have a macro - Proc2. In Proc2 I want to call Proc1. Can someone give me the code to do so. I have tried all sorts of statements and just can't seem to get it to work. Thanks. -- Bill @ UAMS from vba help Run Method See Also Applies To Example Specifics Run method as it applies to the Range object. Runs the Microsoft Excel macro at this location. The range must be on a macro sheet. expression.Run(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9, Arg10, Arg11, Arg...

Chart Series using non-contiguous calls in VBA
I'm trying to create charts in Excel from a bunch of non-contiguous cells using VBA. The cells are Sheet1!$C1:C2,Sheet1!$C4:C5,Sheet1!$C6:C7,Sheet1!$C9:C10, etc. I first tried to set Series.Formula with a string that I generated from the sheet & cell names, but I had enough cells that I hit that 250 character limit in the Series.Formula arguments. I tried a number of other tactics, including: Trying SeriesCollection.Extend (didn't work, since I'm trying to put data from >1 sheet into the chart) Trying to just set Series.Values & Series.XValues separately ...

Full 97
I have inherited a behemoth of an application developed in A97. I have finally completed a successful compile and conversion to A2003. The users' front-end is now being deployed in A2003 Runtime. There is one place where the code is failing. However, it does not fail for every user. All users can successfully run in A97. Most users can successfully run in A2003RT. But there are a handful of users who get the 'ODBC Call Failed' error in A2003RT. It is happening in the code below. I've marked the failing line with **************. -------------------------- Public Sub ...

call vbScript from vba or convert vbscript to vba(Access 2007)?
Hello All: I have .vbs script that I use to loop through a series of xml files and import specific data into .csv file. Later I import the .csv into an access db. Ultimately, I would like to automate the entire process. So I'm looking for some advice/recommendations. The vbScript currently has the file locations and output file hardcoded and I change it each time I run the script. Is there a way to pass parameters/variables for the file location and output file to the vbScript? And could the script then be called from vba with the parameters? Could the data I...

Can't call a sub in a UserForm using Application.Run
I'm having problems calling Public Sub XXX that is in Userform1. Tried Application.Run "Userform1.XXX" but will not work. Works OK if XXX is in a Standard Module, Thanks for any help. Is the userform loaded? You aren't suppose to call user form routine dirrectly. If yo have common code move the macro from the userform to a module and then call the routine.. You can call the common code from a userform, right! -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www...

Cell call out 03-01-10
Hi, I have a spread sheet that when you put your pointer on that cell you get a tip, it is not a comment, how do I edit that? Thanks Still data|validation. Barry wrote: > > Hi, I have a spread sheet that when you put your pointer on that cell you get > a tip, it is not a comment, how do I edit that? Thanks -- Dave Peterson Many thanks Dave! "Dave Peterson" wrote: > Still data|validation. > > Barry wrote: > > > > Hi, I have a spread sheet that when you put your pointer on that cell you get > > a tip, it is not a com...

Activating calling application
Hi , I have a MFC application that calls a modal dialog in a COM ATL exe. That works fine. After switching to a different application (ie my MFC application gets deactivated) , clicking on the task bar to activate my MFC application again has no response. I tried overriding the OnActivate, OnActivateApp and WindowProc in the COM ATL exe's Main Frame and Dialog class, but the WM_ACTIVATE message does not get trapped there . Any suggestions ? Regards, Diana ...

Calling VBA subroutine from a query?
Can I call a VBA subroutine from within an Access query? I wrote some English to Metric conversion routines in the Access VBA code and would like to run a query on the data that will return coverted values. I need to be able to execute this from outside the database (run the query from another program). Yes. The function must be a Public Function in a standard module. You use a calculated control to return the results of the query. ConvertedValue: MyFunction([SomeField]) -- Dave Hargis, Microsoft Access MVP "DavidY" wrote: > Can I call a VBA subroutine from within an ...

Calling Workflow From the onLoad event of the form
Hello I am working with Crm3.0 and want to know that Is there any way we can call workflow from the form's onload event. Thanks in Advance. Regards -- Jaber This link should help you out. It's invaluable: http://blogs.infinite-x.net/2007/06/15/launching-a-workflow-rule-from-javascript/ HTH "Jaber" wrote: > Hello > I am working with Crm3.0 and want to know that Is there any way we can call > workflow from the form's onload event. > Thanks in Advance. > Regards > -- > Jaber Thanks MD Just the blog is really invaluable. Thanks -- Jaber "M...

[ann] Calling Net Framework Classes from vbs
This is a multi-part message in MIME format. --------------060906080207030403000604 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit If you install the net framework, you will get "a few" of the net framework classes installed in your registry -- but far from all. You will find a few postings here about using a couple of those (registered) net framework classes -- but in general there has been a somewhat negative consensus about using ALL the net framework classes. I cam across a posting in the "BCX" (Basic to C La...

Best method to call a long stored proc with WCF
Say have a stored procedure that takes about 10min to 1 hour to run and I need to call it with WCF (silverlight). I'd basically want to fire off the query, have the wcf service fire off the query in a thread or something. Then have the wcf return to the silverlight program and say 'Ok the SP is running' The silverlight app would then make some wcf calls that would count the rows in table x, to see what the progress is. Or the SP could update another table with the status. Could the WCF service just call a thread return 'OK running', and still have the SP runn...

SIZE Window, Tile, Worksheet, Workbook, Whatever it's called.
Is it the tile, the window whatever you call it when you call it it's proper name it is my project. The part inside the main excel window is smaller than the main excel window and I can't maximize it. I can max and min the main window but not the tile. I thought it was a tile so I will, until corrected, call it the tile. The help menu says to either double click the title bar OR left click the box at the top right of the title bar. If I could make either of those happen I would not be writeing this. If I close the said project and open another excel file, new or completed, ...

Calling exe from MFC application and storing out in buffer for further processing.
Dear All, I m developing a application in which i need to call a exe whose results/output, i wanna store in buffer for further processing. Please give me the solution fo doing that. Thanx in advance. regards, dinesh spawn, createprocess, system, winexec, etc. "Dinesh" <dinesh@netplexusindia.com> wrote in message news:%23TgbQQFLEHA.3332@TK2MSFTNGP10.phx.gbl... > Dear All, > I m developing a application in which i need to call a exe whose > results/output, i wanna store in buffer for further processing. Please give > me the solution fo doing that. > Thanx in a...

Call stack
Hi all: I've seen most the program retrieve "AddrPC.Offset" by thread context, but in this implementation the stackwalk(...) simply feed with "getprogramcounter()" address. and it is startsfrom there to trace back.My question is what "AddrPC.Offset" stands for, is it a element inside stack frame, and I know "AddrFrame.Offset" stands for the current frame pointer.In addition the "offset" specified here base on what?void foo1(){ foo2();}void foo2(){ foo3();}void foo3(){ STACKFRAME64 frame; DWORD_PTR programcounter; programco...

Calling a Oracle Stored Procedure?
How can i call a Oracle stored procedure from my VC++6.0 The Stored Procedure accept as well as return some values. Thanks in advance Reny http://www.fruitfruit.com/vc/database/oracleprocedure.cpp "Reny J Joseph Thuthikattu" <reny@bxtech.com> wrote in message news:Os909#O2DHA.4032@tk2msftngp13.phx.gbl... > How can i call a Oracle stored procedure from my VC++6.0 > > The Stored Procedure accept as well as return some values. > > Thanks in advance > Reny > > > > ...

Calling unmanaged code from managed MFC worker thread
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC application. Furthermore, I use a pointer to an unmanaged function to jump back into the managed dll. The managed part is basically a remoting enhancement which asynchronly initiates a call from the remoting thread to the MFC application. The information is collected within the main thread of the MFC application. The managed code dll is invoked via a function pointer. From the managed code addition...

Creating a DLL that would bridge an unmanaged Delphi call to managed C#
Hello, I'm trying to create this DLL that will get called from a Delphi program. In order to interface the unmanaged Delphi program with the managed C#, I'm trying to make an intermediary bridge DLL. So far I've been able to make it accessible to the Delphi program, but I'm having problems returning a string which is passed as a pchar parameter. Delphi signature for the function I'm implementing: function ElectronicPay(const input :pchar, var output :pchar): boolean; export; stdcall; C# bridge implementation so far: [DllExport] // http://www.codeprojec...

calling methods on CWinThread object
I'll ask the short version of my question first: Is it safe to just call methods on a CWinThread object as a way of talking to the thread? I understand that this could cause blocking but I am not worried about that. Are there any other problems that could occur? Read on for more details. I have been searching around for the past week or so for the best solution to a threading problem that I am having. Basically I am trying to create a threaded modal progress dialog with a maximum of responsiveness and a minimum of message pumping. The purpose is to have quick-reacting cancel button (...

Phone Call Errors in CRM 4.0
Hi All, Got a couple of errors in a recent upgrade from CRM 3.0 to CRM 4.0. The upgrade went smoothly and all users are logging on fine. Problem one:- Users when accessing the phonecall entity and saving, the screen is coming up with CRM encountered an Error send report to microsoft (but still saving the record) - is this a db permissions issue? Problem two:- When creating a new appointment the resources and accounts fields are greyed out. Any help or pointers on this would be great. Thanks in Advance Hi, We had some very similar issues after doing our upgrade to CRM4, and ended u...

Change default application used by the "Call Contact" feature
Hi there! This is the situation in my compagny : we've recently implemented the "Asterisk" VoIP solution. It works pretty well with the "eyeBeam" softphone. However we have a problem in the MS Outlook 2003 application. Indeed, even if the add-in available in the contact section works, we'd like to directly use "eyeBeam" when we use the "Call Contact" feature. The feature is available when we do a right-clic on a contact name in an email header, then "call", finally "call NUMBER". Actually, its lauches the "Windows Live ...

Call Link Table Manager windows from VBA
Hi, I have a database put in the shared drive with front end (on user PC) link to it. Now several users wnat to have a copy of the backend on their laptop so that they can refer to the infomation on the database while working in the field. I thought to allow them to copy the backend mdb to their laptop and allow them to relink tables but I cannot find a way to call the Link Table Manager since the menu bar is disable. Is there a way to call Link Table Manager from VBA? SF You would be better to implement some re-linking code. This code will check for the DB on the network share an...

ChtmlView - OnBeforeNavigae
With IE7 when using ChtmlView, the OnbeforeNavigate2 event will fire when there is a HTTPXML.send request (Ajax call) But the URL is shown as about:Blank, ad all form data is empty. Does anyone know a way to find out what the full Ajax Request string is? ...