display smallIcon on my dialog.
"Joseph M. Newcomer" wrote:
See below...
On Thu, 24 May 2007 02:34:00 -0700, Yael <Yael@discussions.microsoft.com> wrote:
Hi,
I have a method calling to my dialog.
I'm calling to this method to show mt dialog is in the start ( InitInstance())
*****
BOOL CMyApp::InitInstance()
{
CMyDialog dlg;
dlg.DoModal();
}
and in the OnCheckNow() option from the menu.
I want to display only one performance of this dialog.
****
I'm confused. If you are showing the dialog in OnInitInstance, where is the menu? In the
dialog? Does this mean you have a dialog-based app? What is the relationship of the
dialog to the app? What do you mean by "one performance"? Do you mean you only want one
instance of the program running at a time? Please clarify
*****
I set CListViewDlg dlg as global var,
then in the method that create my dialog:
*****
You can generally be fairly confident that if you use a global variable you have a design
error, and it seems especially true in this case. There is no need for a global variable.
It makes no sense at all.
*****
dlg.DestroyWindow();//?????
****
It is a modal dialog. Therefore, before the DoModal, the dialog does not exist, and you
would not need to call DestroyWindow. After the DoModal, the dialog does not exist, and
there is no need to call DestroyWindow.
*****
int nResponse = dlg.DoModal();
It's correct to DestroyWindow anyway??
****
No.
****
it's working to me..but is it a correct way to do this?
****
Eliminate DestroyWindow, elliminate the global variable.
joe
*****
Thanking you in anticipation!!!
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm