Click here to Skip to main content
15,911,132 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPassing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 9:28
CrocodileBuck9-Apr-08 9:28 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery9-Apr-08 9:41
Mark Salsbery9-Apr-08 9:41 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 9:55
CrocodileBuck9-Apr-08 9:55 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 10:21
CrocodileBuck9-Apr-08 10:21 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck9-Apr-08 22:47
CrocodileBuck9-Apr-08 22:47 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck10-Apr-08 3:34
CrocodileBuck10-Apr-08 3:34 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Nelek10-Apr-08 4:49
protectorNelek10-Apr-08 4:49 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery10-Apr-08 6:11
Mark Salsbery10-Apr-08 6:11 
Plus if you reply to your own posts, I never get an email notifying me that you posted Smile | :)

You have the enter key event at the edit control class.

Now you need to somehow relay that info to the view.

There's an infinite amount of ways to do that. 
The easiest thing to do would be to post a user-defined message to the parent of the edit control's parent.
You could also post the message to the app's main window - depends on your window hierarchy.

Let's say your window hierarchy is like this:

FrameWindow
   ToolBar
      Edit Control
   View

To get a message to the view from the edit control, post the message to the parent of the edit control's parent,
which is the frame window.  Add a handler for the message in the framewindow class.  In that handler, GetActiveView()
can be used to get the view window to forward the message on to.

That's one example using window messages.

Another alternative is to pass window object pointers down to the edit control at creation time, and
call methods of the window class directly from the edit control class.  This solution is much less elegant
because it binds a bunch of window classes together in a way they can't be reused easily...not a good
object-oriented design.

Mark





Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck10-Apr-08 23:29
CrocodileBuck10-Apr-08 23:29 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
CrocodileBuck11-Apr-08 0:04
CrocodileBuck11-Apr-08 0:04 
GeneralRe: Passing datas from an editbox in the toolbar to the view.cpp Pin
Mark Salsbery12-Apr-08 5:58
Mark Salsbery12-Apr-08 5:58 
GeneralDLL Thread_attach Pin
ForNow9-Apr-08 6:46
ForNow9-Apr-08 6:46 
GeneralRe: DLL Thread_attach Pin
CPallini9-Apr-08 7:55
mveCPallini9-Apr-08 7:55 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 12:46
ForNow9-Apr-08 12:46 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 12:58
Mark Salsbery9-Apr-08 12:58 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:09
ForNow9-Apr-08 13:09 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 13:11
Mark Salsbery9-Apr-08 13:11 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:15
ForNow9-Apr-08 13:15 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 13:20
Mark Salsbery9-Apr-08 13:20 
GeneralRe: DLL Thread_attach Pin
ForNow9-Apr-08 13:25
ForNow9-Apr-08 13:25 
GeneralRe: DLL Thread_attach Pin
Mark Salsbery9-Apr-08 8:05
Mark Salsbery9-Apr-08 8:05 
GeneralRe: DLL Thread_attach Pin
cmk9-Apr-08 19:25
cmk9-Apr-08 19:25 
GeneralRe: DLL Thread_attach Pin
ForNow10-Apr-08 6:16
ForNow10-Apr-08 6:16 
GeneralRe: DLL Thread_attach Pin
cmk10-Apr-08 6:41
cmk10-Apr-08 6:41 
GeneralRe: DLL Thread_attach Pin
ForNow10-Apr-08 13:48
ForNow10-Apr-08 13:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.