|
Hi Naveen
Thanks for your valuable information
This is Krishna Kumar
KK
|
|
|
|
|
kk.in wrote: This is Krishna Kumar
have we met?
nave
|
|
|
|
|
Naveen R wrote: have we met?
hai Naveen
you find friend here
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
I am very happy to find friends from here. I already know two krishnakumar's. So I just want to know whether he is any one of them?
nave
|
|
|
|
|
Naveen R wrote: I am very happy to find friends from here. I already know two krishnakumar's.
he he he .. good!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
No, But i heard about u from Nishad
KK
|
|
|
|
|
hooo.
He told me about u when I show ur post to him. But he was not sure.
I suggest u not to show the message in the Existinstance. If ur application is a dialog based one, Show the message box in the Initinstance after the DoModal() call to the dialog.
nave
|
|
|
|
|
well Where r u from? Working in which company?
nave
|
|
|
|
|
Naveen R wrote: try the below code. It just remove the WM_QUIT message.
is there any relation between ExitInstance and WM_QUIT message!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
When I saw his question, I started investigating the problem. I tried calling DoModal for a dialog. Inside the DoModal function i found that the message loop returned immediately.this was because it had a WM_QUIT message in the message queue. I think the WM_QUIT message that gets posted when we close a dialog resides in the queue.
nave
|
|
|
|
|
See if MSDN article Q138681 is of any help.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
MFC Dialog Based Applications generally act up in the following way:
1) Initialize MFC
2) Call InitInstance. Create and show the dialog box here, if it's a modal dialog box application
3) The dialog box terminates
4) InitInstance returns FALSE.
5) Call ExitInstance.
6) Terminate.
When a Dialog Box application's ExitInstance is running, the application's message pump is shut down already, and the application is preparing to terminate. Calling MessageBox will order the box to be a child of the desktop window, and will freeze the desktop while the box is being shown. This is generally a bad idea, since your application is outrightly blocking the desktop for the sake of displaying it's own message.
Put the MessageBox call to somewhere else. Anywhere but ExitInstance should do quite fine.. Perhaps right after the dialog terminates in InitInstance, but before InitInstance returns FALSE ?
- Antti Keskinen
----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"
-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
|
|
|
|
|
Antti Keskinen wrote: When a Dialog Box application's ExitInstance is running, the application's message pump is shut down already
When u call DOModal for a dialog, it creates a message pumps there. So u can't say the message pump is shutdown or like that...
Antti Keskinen wrote: Calling MessageBox will order the box to be a child of the desktop window, and will freeze the desktop
never. U can't freeze the Desktop
nave
|
|
|
|
|
The DoModal dialog can create the message queue for the dialog window, but the thread's message pump (CWinApp::Run) no longer executes when ExitInstance is running. This means that only modal dialogs are available. If you create a modeless dialog during ExitInstance, problems are guaranteed.
Regardless of this detail, I still consider it a bad idea to create message boxes in ExitInstance. I consider it bad coding. Like reserving memory in an object's destructor. It's a sign of bad design
Didn't know about the desktop window though. Thought it would behave just like any other window in the system. But now I know better then, thanks for clarifying
- Antti Keskinen
----------------------------------------------
"If we wrote a report stating we saw a jet fighter with a howitzer, who's going to believe us ?"
-- R.A.F. pilot quote on seeing a Me 262 armed with a 50mm Mauser cannon.
|
|
|
|
|
Antti Keskinen wrote: If you create a modeless dialog during ExitInstance, problems are guaranteed.
Even if u try to show a Modal window, it will not work( After all, message box is a modal window or latest block the code)
Antti Keskinen wrote: I still consider it a bad idea to create message boxes in ExitInstance
I too dont recomment showing a message box in the existinstance.
nave
|
|
|
|
|
Hi,
I have a structure ...
typedef struct
{
CString progId;
IEFCMainForm * pIForm;
}NODEDATA;
char buf[200];
// The structure is initialized
NODEDATA *nd=new NODEDATA;
nd->progId = _T("EFCSkinView.EFCForm.1 ") ;
sprintf(buf,"%s",nd->progId);
nd->pIForm=NULL;
if (nd->pIForm == NULL)
{
CLSID clsid;
wchar_t lszProgID[200];
mbstowcs(lszProgID,buf/*nd->progId*/,nd->progId.GetLength());
lszProgID[nd->progId.GetLength()]=0;
CLSIDFromProgID(_T("EFCSkinView.EFCForm.1 "),&clsid);
HRESULT hr=CoCreateInstance(clsid,NULL,CLSCTX_INPROC_SERVER,IID_IEFCMainForm,(void**)&(nd->pIForm));
// Iam unable to get clsid ,iam getting GUID_NULL for clsid eventhough iam getting correct progid
if(FAILED(hr))
{
CString str=_T("Failed to Create ");
AfxMessageBox(str+nd->progId);
return;
}
Any suggetions would be helpful
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
narayanagvs wrote: CLSIDFromProgID(_T("EFCSkinView.EFCForm.1 "),&clsid);
check Registry under HKEY_CLASS_ROOTS , is your EFCSkinView exist there, my suggestion would be go for version independent id for EFCSkinView Libaray by using EFCSkinView.EFCForm instead EFCSkinView.EFCForm.1
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And you
|
|
|
|
|
I am using VC++ .NET(8 Version) to build a Dialog based application, however, my
application allows user to input command arguments from the Command prompt
window.
I want to write some help message when user enters "Some.exe /?" at the command prompt. How can I write text to the command prompt window if user enters the above arguments?(Some.exe /?)
Thanks in advance.
|
|
|
|
|
when u start a dialog based application from the command line, the moment u press enter a new process is created. So the new process dont have any relation with the console. But in a console based application, both the console and the new application exists in same process. Better u output the help string in a messagebox( check the regsvr32.exe application. It shows the help in message box )
nave
|
|
|
|
|
Thanks for the Reply.
Is there any way to get the HANDLE of the console where we are executing our Dlg Based Appln. I have read about AllocConsole() and GetStdHandle() but could not corelate with my problem. Plz Help
|
|
|
|
|
zxc89 wrote: Is there any way to get the HANDLE of the console
sorry i dont know. Even if there is a way what u gone do if i immediately close the console after pressing enter?
nave
|
|
|
|
|
|
hi DavidCrow,
In both of the link u give the parent application have to redirect the child applications stdout. This is not possible in his case since the parent applicaton is command prompt. He is searching for a way to redirect the output from the child process itself.
nave
|
|
|
|
|
Can anyone Help.I had tried different ways but i coulnot succeed.
|
|
|
|
|
I received the value from one class. now i need send this value to the socket at another class. how do retrieve this value from different class?
void CIPConfig::OnBnClickedButton2()
{
int level, comm;
...........
level = atoi(v_level);
comm = atoi(v_comm);
temp.Format("%d", level);
sIOSetting = temp;
temp.Format("%2d", comm);
sIOSetting+=temp;
}
now i need send sIOSetting to socket in CConfigurationView.
how do i do it?
|
|
|
|