Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Helppppp.........Multiple document tabs
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Helppppp.........Multiple document tabs

 Post Reply Post Reply
Author
Message
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Topic: Helppppp.........Multiple document tabs
    Posted: 08 September 2008 at 11:31pm
Hello,
I tried to find for switching the child tabs in OnActivateView event,But unfortunately i couldnt found the exact case.
 
see,Herewith i am giving the text file in which the two cases i have given.
 
1)The first case works exactly for switching the tabs,But when user do alt+tab to switch to some another application,it fails.
In first case i get the bool variable bModified as TRUE.
so it works proper for switching the child view.But dont know why it fails while doing alt+tab for switching between applications.
 
 
2)The second case works when user do the alt+tab,But it fails when he switches between the child tabs.
in this case i get the bool variable FALSE.
 
 
I know,this is pure MFC,and this kind of querry shouldnt be asked on this forum.But i am really screwed at this point.and couldnt find the way.
 
My application is multiple document application  and only one view for each document. And My requirement is,whenever user switch the document,he should save the previous document.
If we handle it in OnActivateView,we will have to check bActivate variable is false and then save the document.This it is doing,But it gets that variable false in alt + tab condition also.So whenever user does alt+tab it asks to save the document when we come back to our application.
How can i avoid this?
Please guide me,what exactly shall i do to catch the childview tabs click event? Or Please guide to avoid the alt+tab problem. Because even if we get the tab clk event,i think we wont be able to get the previous document that time.This i am not sure,just guessing.
Please tell,what can be the possible solution for this problem.
 
 
Thanks And Regards,
Vijay.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2008 at 5:26am
Hi,
 
another option is to catch
 
ON_WM_MDIACTIVATE()
in CMDIChildWnd derived class. don't forget to call base method.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2008 at 6:27am
Hi Oleg,
Thanks for replying immediatly.
Dont you think,here also we will have to face the same problem?
My problem is to save the deactivating document.
Cant we trace the alt+tab by any other means?
 
Thanks And reagards,
Vijay.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2008 at 2:58pm
Hi,
TabClient sends WM_MDIACTIVATE only if MDI child changed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
vijaymahajan View Drop Down
Groupie
Groupie
Avatar

Joined: 16 June 2008
Status: Offline
Points: 92
Post Options Post Options   Thanks (0) Thanks(0)   Quote vijaymahajan Quote  Post ReplyReply Direct Link To This Post Posted: 10 September 2008 at 12:01am
Hello,
Thanks.It really worked.
 
sorry oleg,one more question. If the user goes for saving the document,i will open the savefiledialog. If he do not enter any path,and directly press the cancle button,it means he do not want to save.
Then in that case i will have to open the previous document again.
Can i do that?Is it possible? What can be the possible solution for that?
 
Because in this case,he has already clicked on the new childwnd tab. so new child window will get activated internally. then even if he clicks cancle button in savefiledialog,we wont be able to show the previous view. is there any method which can detect the last active tabclient? If not,Can we prevent the OnMdiActivate event to get fired in that case?
Can u put some light on this issue also?
 
Thanks again for your earlier reply. It really helped me a lot.
 
Thanks And Regards,
Vijay.
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.031 seconds.