Forcing a view to be the active view

Hello!

I have an SDI application that has a splitter window with two views. The
first view is an CFormView and the second is a CView. I want the CFormView
to always be the Active view. Even if the user selects the CView.

How do I accomplish this?

// Anders
0
5/17/2004 8:11:16 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1101 Views

Similar Articles

[PageSpeed] 48

Anders Eriksson wrote:

> Hello!
> 
> I have an SDI application that has a splitter window with two views. The
> first view is an CFormView and the second is a CView. I want the CFormView
> to always be the Active view. Even if the user selects the CView.
> 
> How do I accomplish this?
> 
> // Anders


I'd first go for what seems obvious solution: Add OnActivateView handler 
to your CView derived class, and use CSplitterWnd's SetActivePane 
method. But remeber to make MainFrame's m_wndSplitter variable public.


void CTest3View::OnActivateView(BOOL bActivate, CView* pActivateView, 
CView* pDeactiveView)
{
	CMainFrame* pMain = (CMainFrame*)AfxGetMainWnd();
	pMain->m_wndSplitter.SetActivePane(0, 0);

//	CView::OnActivateView(bActivate, pActivateView, pDeactiveView);
}


Aleksandar Vukelja
0
spam7781 (33)
5/17/2004 8:56:52 PM
Hello Aleksandar!

On Mon, 17 May 2004 22:56:52 +0200, Aleksandar Vukelja wrote:

> Anders Eriksson wrote:
> 
>> I want the CFormView to always be the Active view. Even if the user
>> selects the CView.
> I'd first go for what seems obvious solution: Add OnActivateView handler 
> to your CView derived class, and use CSplitterWnd's SetActivePane 
> method. But remeber to make MainFrame's m_wndSplitter variable public.
> 
This worked like a charm!

Thank you very much!!

// Anders
0
5/18/2004 6:10:15 AM
Reply:

Similar Artilces:

Force Uninstall
All, A coupla questions . . . Suppose I just want to forcefully uninstall Exchange 2000 from a server, and an org. Currently the uninstall fails because (as mentioned in a previous post) I have users that still show as being on that server, however the store that those users were on is no longer there (because of a disaster). Is there some way to force the uninstall? Another question. I have two healthy clustered machines running currently. Suppose I just remove the object for the old exchange server from the ESM? Assuming I have performed all of the other steps steps (like moving o...

How do you view all 4 postcards on one page?
I can't find the option to be able to view all 4 postcards on one page. I would like to put different names on each one. If you aren't mail merging then setup your cards manually. Page setup, landscape. Arrange, Grid Guides, 2 rows 2 columns. Work out your margins, you will want the spacing in the grid guides twice the size of your margins. The top and bottom margins aren't important but the others are if you want a balanced look. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "tarynthesky" <tarynthesky@...

Locking The Outlook so user can not change the view.
Is there any way to lock Outlook 2000 and or Outlook 2003 so user can not change the view setting under the View Menu? I have several user that keeps changing the view and ask me to change it back. They will swear that they did not change. I will to lock it down so they can not loose any toolbar or anything else. Thank you Belmont ...

forcing user input into cells
howdy all... i'm new to doing stuff with excel have a bit of a background in javascript programming what i'm trying to do is force a user to enter something, anything int a specific cell if the user tries to tab past the cell and leave it blank, i want a error to come up, telling them that they have to enter something befor they can continue on with entry into other cells any help would be much appreciated -Thank -- georgi ----------------------------------------------------------------------- georgio's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=164...

Force quit
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Closing Word get error message &quot;A file error has occurred. Check your network connections or make sure the disk is properly inserted&quot; Am then required to use force quit. Anybody have solution? Make sure Office & OS X are fully updated. If they are & you still encounter the problem, crashing on Quit is usually the result of one of theses causes: Need to repair disk permissions Damaged preference files Corrupt Normal.dotm template See this page for the respective links in t...

How can I view archived messages?
When I try file/open/outlook data file it takes me to an archive folder that is empty. Is there another way to find my archived messages? Check your Archive settings, from there you can see both the path & Archive name, then open that Archive, if its not already open "merlin64" <merlin64@discussions.microsoft.com> wrote in message news:26C4451C-4F22-4312-BA78-8CEF29F6E1C9@microsoft.com... > When I try file/open/outlook data file it takes me to an archive folder > that > is empty. Is there another way to find my archived messages? First I sug...

OWA, Can View Folder/Mail, but Cannot Send.. Why ?
When using OWA, I can View my Emails on the company's 5.5 SP4 Exchange Server, I can use Find Name, and it will Search.. But I cannot send an Email, I get a window that pops up and says: "Failed to Send Item" Thanks... my_email@is_private.com (XP User) wrote in news:aFtYb.86583$cE3.30504327 @news4.srv.hcvlny.cv.net: > When using OWA, I can View my Emails on > the company's 5.5 SP4 Exchange Server, I can > use Find Name, and it will Search.. > > But I cannot send an Email, I get a window that pops > up and says: "Failed to Send Item&quo...

Campaign Activity (Email /Email Mail Merge)
Hi, We have a customer that would like to send an email or email via mail merge from campaign activity in the name of the company (from a general email address), instead of sending the email from the user that owns the campaign activity or the user that owns the account/contact/lead. Do you have any idea of how we can do this? Thanks, Regards Rute Dias ...

Forcing Appointments
I use outlook to schedule appointments with my customers with specific employees. I have a scheduling department that does this scheduling via outlook. The employees have no option to reject or modify these appointments; therefore, I would like to force this on their calendar with them having to accept it and not allowing them to modify it. Additionally, I need to know real time once they are scheduled. Right now I don't know they are scheduled until they accept and that sometimes takes too long and then they are inadvertently double booked by the scheduling department. So how do ...

Outlook 2003 :: Views :: Automatic Formatting
Hello all. I have two questions about views. Hope you can help me. 1. How to higlight messages from the certain domain? In the dialog "Automatic Formatting" I can define condition to check From field (for example, "where From field contains @microsoft.com"). But the view checks only sender's name (not e-mail). However, I can filter by e-mail using From field in the rule (Rules and Alerts). What are the differences? Because of internal interfaces, I guess. Rule can access to "source data" but view can access to "prepared- to-view data" only. I could ...

Force REPLY to go back to distribution list
I have an issue whereby a department is insisting that they want their mailing lists marked so that any time anyone clicks REPLY (not "REPLY ALL" - they refuse that as an acceptable solution, it must be REPLY) that the reply message goes back to the distribution list and not the message originator. They further insist that this capability must occur on the mail server (and not on Outlookclient side), since they use a multitude of different mail clients (many on Unix/Linux) and therefore it is a server-side responsibility to make this happen. They say that this capability exists in ...

Inability to edit or view queries
I have a spreadsheet on a network, that queries an Acess database, on the same network. When I try to view/edit the query the option is greyed out. Why can't I get into the query? I've got read and write priviledges. Any help/ideas would be appreciated. ...

Displaying Contacts in Calendar View
Help! I have started using Outlook 2003 for my appointment calendar. I have a limited number of clients who have regular appointments. Naturally, I type the name of the client in the Subject field so it displays on the calendar. However, I also need to add the client to my contact list and link the contact to the appointment. This requires several steps. Is there a way to have the contact show on the appointment box in the calendar view? This seems too obvious a feature to have been neglected but I can't figure out how to do it. Alternately, is there a way to make an automatic link...

Clipping the MainFrame View with another View
I am creatiing an alternate custom view (derived from CView) for my SDI application, which I show in its own custom frame derivative of CFrameWnd. I create the frame with CreateObject(), then I attach the View to it via the CCreateContext argument passed in LoadFrame(). Works great!. However, I would like this new view to clip the main frame window even when it is not in focus, instead of hiding behind it when not in focus (similar to the way a modeless Dialog window shows). I have been experimenting with changing windows styles for the new frame and the new view by subclassing the CRE...

force
...

Forcing an ActiveX control to serialize it's properties.
Is there a way to force an activeX control to serialize it's properties? Kurt "Kurt" <k_nojunk@larimore.net> wrote in message news:OqS15%23p3DHA.3224@tk2msftngp13.phx.gbl... > Is there a way to force an activeX control to serialize it's properties? > > Kurt > > Kurt, Try getting a pointer to the IPersistStorage interface via QueryInterface. Then call the method IPersistStorage::Save which needs an IStorage* to specify where the properties will be saved to. ...

Forcing an account
Hi All Is there anyway to get Outlook 2002 and/or 2003 to force to use a certain mail account for certain contacts? For example for contact A, B and C I want to always send new messages, replies and forwards via mail account 1 and for contact D, E and F I want to do the same using mail account 2. I don't want this to deviate even if one of these contacts has sent an email to an alternate mail account. Even though I set my main account as the default, when certain emails come in on my other accounts I can't force my replies or forwards to go to a certain account. Are there any hidd...

Force PasteSpecialValues in Excel 2007
There was a very nice piece of code written by Aaron Bush (Oorang on MrExcel) in 2007 which disabled cut and copy execution in excel, forcing the copy to copy only values but maintaining the ability to undo (http://www.vbaexpress.com/kb/getarticle.php?kb_id=957). Unfortunately, this code fails in several ways in Excel 2007. 1/ It does not disable ribbon cut/copy/paste features 2/ Paste still functions normally when using <enter> to paste the previously copied cell 3/ If you are copying from a locked cell in a protected sheet, the code generates a 1004 error (though the p...

Active Directory Issue
The Network Administrator for my client took it upon himself to remove several past users from the Active Directory without removing them from MSCRM. The application now throws an error anytime any of the associated records are manipulated "Object cannot be found . . . ." I have searched the techknowledge database and found an article that listed three options. One was to remove the MSCRM license and replace it - it didn't work. The next was to restore the Active Directory using an Authoritative Restore - the network admin had not included the Active Directory locat...

How force table update when no bound field updated?
I have a main form with a 'Balance Due' field. There are two balance due controls, one unbound (displayed) and one bound (hidden). I also have a subform which is a continuous form containing payment data. When payment details are entered or changed, the balance due on the main form and in the bound table needs to be updated. The total of payments is summed in the subform footer and the balance due (unbound control) refers to this subform total. In main Form BeforeUpdate, I copy the unbound balance due to the bound balance due. The problem is that when only payment data is...

Can not view e-mail
Message bar and incoming mail states that mail is being received, but it does not "appear" when the incoming box is opened. However "some" of my mail comes through. Can you help me with this? What version of Outlook and do you have a view set on your inbox or are you sorting by icon? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, Sherri asked: ...

Force Secure
Is there any way to force the system to secure itself after a cashier uses the time clock? Great Question. But No. "Scott S" wrote: > Is there any way to force the system to secure itself after a cashier uses > the time clock? > > > ...

Outlook Today View
In the Outlook Today view there is a button entitled "Customize Outlook Today." When I hit this button nothing happens. Anyone seen that behavior before? See if the following KB article applies to you; http://support.microsoft.com/?id=820575 -- Roady [MVP] www.sparnaaij.net Microsoft Office and Microsoft Office related News Also Outlook FAQ, How To's, Downloads and more... Tips of the month: -Create your own fully customized Toolbar -Creating a Classic View in Outlook 2003 Subscribe to the newsletter to receive news and tips & tricks in your mailbox! www.sparnaaij.net ...

sql view
Does anyone know why the SQL view may not be available to use for a table of form? I have read that you can get the SQL view by clicking on the view button drop down list, but it isn't there for some reason. The only view options showing are Design View, Datasheet View, Pivot Chart View, and Pivot Table View. I don't see the SQL View option. Can you tell me how to find it? Thanks! Yes, Just bring up the property sheet for the form (while in design mode). Then select the data tab. Now, click on the Record Source property field. Then, you can view the sql by clicking on the [...] b...

two exchange servers, one calendar view?
Is there any way to combine the information from two different Exchange calendars(from 2 different servers) into one view? Are there any add ons that can accomplish this? We have some employees that are working with another company on a long term project, and the two scedules are conflicting. I told her to just use one as a primary inbox that people must realize is your default for scheduling appointments, but she I'm sure some will slip through the carcks and create larger headaches down the road. On Tue, 6 Sep 2005 09:11:05 -0700, Dan <Dan@discussions.microsoft.com> wrote: ...