URGENT ! HELP NEWBIE plz - easy dialog question 
Author Message
 URGENT ! HELP NEWBIE plz - easy dialog question

Hello, heres my problem:

I have a dialog, call it from a view with .DoModal()
Now I have the routine handling a command button of the dialog in the view,
but its not being called. Why?
(the routine was insertet in class wizard, I just handle the
ID_name_of_the_button in CMyViewName).

I tried to give the dialog a pointer to the view calling it with
CMyDialogClass myDialog(this);
It doesnt help either.

How can my view receive the window message from the view; what am I doing
wrong ?

Help plz !!!




Fri, 23 Aug 2002 03:00:00 GMT  
 URGENT ! HELP NEWBIE plz - easy dialog question
No. Modal dialogs handle their child window events themselves. Either make
it non-modal or have a call back function.


: Hello, heres my problem:
:
: I have a dialog, call it from a view with .DoModal()
: Now I have the routine handling a command button of the dialog in the
view,
: but its not being called. Why?
: (the routine was insertet in class wizard, I just handle the
: ID_name_of_the_button in CMyViewName).
:
: I tried to give the dialog a pointer to the view calling it with
: CMyDialogClass myDialog(this);
: It doesnt help either.
:
: How can my view receive the window message from the view; what am I doing
: wrong ?
:
: Help plz !!!
:

:
:



Fri, 23 Aug 2002 03:00:00 GMT  
 URGENT ! HELP NEWBIE plz - easy dialog question
thnx, I did it,
but it didnt work either.

I had another non-modal dialog belonging to my view (where it worked ! - the
code was 1:1, the only difference was that I have created a menu point for
the button in the other dialog before I created this button and used its
menu - ID ), took one button from there, copied it, and suddenly it worked,
dont ask me why, it did.
I think its something about the automatical number gathering in the
ID-resources.

anyway, thanks for help !
Andreas



Quote:
> No. Modal dialogs handle their child window events themselves. Either make
> it non-modal or have a call back function.



> : Hello, heres my problem:
> :
> : I have a dialog, call it from a view with .DoModal()
> : Now I have the routine handling a command button of the dialog in the
> view,
> : but its not being called. Why?
> : (the routine was insertet in class wizard, I just handle the
> : ID_name_of_the_button in CMyViewName).
> :
> : I tried to give the dialog a pointer to the view calling it with
> : CMyDialogClass myDialog(this);
> : It doesnt help either.
> :
> : How can my view receive the window message from the view; what am I
doing
> : wrong ?
> :
> : Help plz !!!
> :

> :
> :



Fri, 23 Aug 2002 03:00:00 GMT  
 URGENT ! HELP NEWBIE plz - easy dialog question
Andreas:

The handlers for button clicks on the dialog must be in the dialog class,
because it is the dialog window which receives these messages. In the handler,
you can use the "this" pointer which you passed to the dialog (and saved in a
member variable) to call any (public) member function of the view that you wish.

HTH,

David Wilkinson

================

Quote:

> thnx, I did it,
> but it didnt work either.

> I had another non-modal dialog belonging to my view (where it worked ! - the
> code was 1:1, the only difference was that I have created a menu point for
> the button in the other dialog before I created this button and used its
> menu - ID ), took one button from there, copied it, and suddenly it worked,
> dont ask me why, it did.
> I think its something about the automatical number gathering in the
> ID-resources.

> anyway, thanks for help !
> Andreas



> > No. Modal dialogs handle their child window events themselves. Either make
> > it non-modal or have a call back function.



> > : Hello, heres my problem:
> > :
> > : I have a dialog, call it from a view with .DoModal()
> > : Now I have the routine handling a command button of the dialog in the
> > view,
> > : but its not being called. Why?
> > : (the routine was insertet in class wizard, I just handle the
> > : ID_name_of_the_button in CMyViewName).
> > :
> > : I tried to give the dialog a pointer to the view calling it with
> > : CMyDialogClass myDialog(this);
> > : It doesnt help either.
> > :
> > : How can my view receive the window message from the view; what am I
> doing
> > : wrong ?
> > :
> > : Help plz !!!
> > :

> > :
> > :



Fri, 23 Aug 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. newbie question, plz help

2. plz help - a program that should be really easy (linked list)

3. urgent!!! help plz

4. (Urgent, plz help)Problem getting app pointer in VC1.52 (16bit)

5. Newbie needs urgent help, simple question

6. problem with function for newbie..plz help

7. CMSComm the newbie killer *g* - HELP plz !!!

8. Easy Questions!Urgent!

9. URGENT: A very easy question

10. Urgent Help required - should be easy

11. plz help, fast way to find dialog id?

12. easy newbie question

 

 
Powered by phpBB® Forum Software