|
You can delete it manualy - delete the handler definition from h and cpp files
and also the binding from BEGIN_MESSAGE_MAP/END_MESSAGE_MAP section in cpp file (ON_BN_CLICKED).
If you don't want to edit wizard generated sections of code do (In VC6):
Go to the class wizard, make sure the dialog class is selected,
in Message Map tab see the Member function listbox.
Select your OnButton handler and push Delete function.
Note that you need to delete the implementation of the handler in cpp file manualy.
Pavel
Sonork 100.15206
|
|
|
|
|
For a modeless launch, I get a pointer to the window, so I can senmessage it with that.
But for a modal dialog when I do
CMyDialog myDialog;
myDialog.DoModal()
and then want to send a message to myDialog, will I do this?
<code>CMyDialog* p = &myDialog;
p->SendMessage</code>?
I'd check it out myself in code, but cant right now....
Thanks,
ns
|
|
|
|
|
u can send a message to anything derived from CWnd using this method
If u wanna send to another dialog, u can get its a pointer from FindWindow
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I'm looking up FindWindow right now...
You cant use it to find a window in another app right? It wouldnt know the classname etc....
Thanks,
ns
|
|
|
|
|
if u need to find a child window within a parent window u can use FindWindowEx providing the Window Handle of the CWnd named m_hWnd.
In order to know the class name u can see the output of Spy++ or do like he does! There's even an article on CP that does that!
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
You cannot send a message from the same thread because DoModal won't return until the dialog is closed.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Hi,
I have two PCs and like to see if both have same service packs installed. Where can I find this information in VC6? thanks
|
|
|
|
|
|
I want to use CRecordset and CDatabase classes to open MDB files without registering them on DSN. HOw can i do that and what possible compatibility issues will there be.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Using CDaoRecordset isn't an option?
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
http://www.codeproject.com/database/excel_odbc_write.asp
Papa
Murex Co.
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I am finding Unicode Controls that can run on Windows 98. Help me, please.
Thanks for your help.
|
|
|
|
|
|
First, is it possible to terminate a CDialog (modeless) from the spawning class?
Second, if I am receiving repeated SendMessages from a dll, and this happens at a function call to the dll, will my dialog vanish after all the messages have been sent, or earlier? Will it wait for the dll to finish before executing the next line?
//launch modeless form
//call dll which wil send 100 sendmessages
//terminate modeless form
Third,can you sendmessage from a completely independent app, (not a dll) using the same technique as usual?
Thanks,
ns
|
|
|
|
|
First, is it possible to terminate a CDialog (modeless) from the spawning class?
Yes. Add a handler for a hidden button (or menu command) in your modeless dialog, eg: CMD_HIDDEN_CLOSE , which does this:
CMyModelessDlg::OnHiddenClose()
{
...
CDialog::OnOK();
DestroyWindow();
delete this;
} Then, just post the modeless dialog the CMD_HIDDEN_CLOSE command, eg:
CMyModelessDlg* pModeless = ...;
pModeless->PostMessage (WM_COMMAND, CMD_HIDDEN_CLOSE);
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Third,can you sendmessage from a completely independent app, (not a dll) using the same technique as usual?
Yes, as long as you have the target window's handle.
This (posting or sending messages) is an easy way to "automate" windows because they become responsive to a collection of commands. I suggest using PostMessage unless it's necessary for the command to be executed right away.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Second, if I am receiving repeated SendMessages from a dll...
This is a good example of the distinction between Send/PostMessage() . Your DLL can call SendMessage() or PostMessage() .
However, the termination message should be Post ed, not Send ed in order to ensure that all previous messages are handled before the modeless dialog goes bye bye.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Thanks! I've been stuck for almost a week trying to get my VB dll to send me a message. If this doesnt look i have to do shared memory............aaaargh! It sounds horrible. Plus Ihave to do it in VB and in Vc since the two are talking.....really dont want to, but ...
Thanks,
ns
|
|
|
|
|
If I spawn a modal form can I terminate it from the parent like
myDialog.EndDialog(retVal);
Will retval get filled in if I send it the address of the variable?
Thanks,
ns
|
|
|
|
|
|
So this is fine, right?
CDialog myDialog;
myDialog.DoModal();
myDialog.EndDialog(& nretVal);
Thanks,
ns
|
|
|
|
|
It's not - DoModal doesn't return until EndDialog is called. You'll have to call EndDialog in response to some event.
Tomasz Sowinski -- http://www.shooltz.com
*** Vodka. Connecting people. ***
|
|
|
|
|
ns wrote:
So this is fine, right?
NO!!!
When you call DoModal a dialog is created and shown and a message loop is started. Now when you call EndDialog in one of the message handlers the dialog is destroyed, the message loop exited and then DoModal returns and the value it returns is the value you passed to EndDialog. Get it?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Finally
Thanks,
ns
|
|
|
|
|
No it's not fine. DoModal will not return until the dialog is closed. Therefore your EndDialog will be called for a dialog that no longer exists.
It only makes sense to call EndDialog from a member function of the dialog. EndDialog is only relevant for modal dialogs and, by definition, the calling thread can't continue while a modal dialog is open.
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|