Prob w/ID_EDIT_COPY messaging
Mark Foley -- meftech@concentric.net Sunday, March 30, 1997 Environment: NT 3.51, MSVC++ 1.52 Hi, I have a very perplexing problem that I have almost given up on. In my SDI app I have a single view and a modeless dialog box that can be brought up from the main menu. In this dialog is a normal CEdit control as well as a 3rd party Edit control. Both Ctrl-C and Ctrl-V work properly from this modeless dialog. I would like to add the ability to use the toolbar Edit/Copy and Edit/Paste buttons to accomplish the same functionality. As I am not changing the underlying functionality of either of these functions, all I really want to do is generate the same ID_EDIT_COPY and ID_EDIT_PASTE WM_COMMAND messages and have them go the same route as the Ctrl-C and Ctrl-V do from my dialog. I know that overriding PretranslateMessage() in my dialog will allow me to get the WM_COMMAND ID_EDIT_COPY and PASTE in my dialog for the Ctrl-C/V, but thats not really what I want. My thinking is that I should not have to write any Copy/Paste code, just generate the same conditions from the button as are done for the accelerator keys. I tried intercepting the WM_COMMAND and calling the Default() window proc for the ID_EDIT's but that accomplished nothing. I have spent enough time on this now that I NEED to know how to do it! Thanks for any guidance....
Soumik Sarkar -- soumik@cryogen.com Monday, March 31, 1997 Hi, Look in the file C:\MSDEV\mfc\src\VIEWEDIT.CPP in the equivalent = directory on your machine. Search for the ID_EDIT_PASTE, ID_EDIT_COPY, = ID_EDIT_CUT etc. commands. You will find code for the functions you need = including the ON_UPDATE_COMMAND_UI functions. Hope this helps. Soumik. ---------- From: meftech Sent: Monday, March 31, 1997 5:37 AM To: mfc-l@netcom.com Subject: Prob w/ID_EDIT_COPY messaging Environment: NT 3.51, MSVC++ 1.52 =20 Hi, I have a very perplexing problem that I have almost given up on. In my SDI app I have a single view and a modeless dialog box that can be brought up from the main menu. In this dialog is a normal CEdit control as well as a 3rd party Edit control. Both Ctrl-C and Ctrl-V work properly from this modeless dialog. =20 I would like to add the ability to use the toolbar Edit/Copy and Edit/Paste buttons to accomplish the same functionality. As I am not changing the=20 underlying functionality of either of these functions, all I really want to do is generate the same ID_EDIT_COPY and ID_EDIT_PASTE WM_COMMAND messages and have them go the same route as the Ctrl-C and Ctrl-V do from my dialog. =20 I know that overriding PretranslateMessage() in my dialog will allow me to get the WM_COMMAND ID_EDIT_COPY and PASTE in my dialog for the Ctrl-C/V, but thats not really what I want.=20 =20 My thinking is that I should not have to write any Copy/Paste code, just generate the=20 same conditions from the button as are done for the accelerator keys. I tried intercepting the WM_COMMAND and calling the Default() window proc for the ID_EDIT's but that accomplished=20 nothing. =20 I have spent enough time on this now that I NEED to know how to do it! =20 Thanks for any guidance....
Become an MFC-L member | Вернуться в корень Архива |