|
pAboutDialog->DoModal(); will immediatelly return?
If then instantiation of CAboutDialog has some error.
I know a case cause this situation.
Check the resource id is exist and reffer exact dialog resource.
If resource id is valid, I'm not sure, maybe some declaration is not matched their prototypes or no appropriate message mapping macro defined...
|
|
|
|
|
Yes, pAboutDialog->DoModal()will immediatelly return.
|
|
|
|
|
Then problem is decided to initializing an instance.
All constructor of CAboutDialog, CDialogBase, CDialog are initializing correctly?
Are there some members not initilized or have invalid value?
You can check it by debug mode and step into function.
|
|
|
|
|
transoft wrote: DECLARE_MESSAGE_MAP( );
Did you do the BEGIN_MESSAGE_MAP()/END_MESSAGE_MAP() thing correctly? CDialogBase needs that...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Yes, I did as following:
BEGIN_MESSAGE_MAP( CDialogBase, CDialog )
ON_COMMAND(IDHELP, CMHelp)
ON_WM_HELPINFO()
END_MESSAGE_MAP()
|
|
|
|
|
you are missing the ON_WM_INITDIALOG in the message map.
|
|
|
|
|
transoft wrote: CAboutDialog *pAboutDialog = new CAboutDialog( .... ); ---> CAboutDialog is inherited from "CDialogBase "
pAboutDialog->DoModal();
Just out of curiosity, why not use:
CAboutDialog pAboutDialog;
pAboutDialog.DoModal(); Do you have any controls on CAboutDialog with associated member variables? Is DoDataExchange() correct? Have you tried adding the DS_NOFAILCREATE style?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Most probably it fails during dialog construction (CreateDialogIndirect).
Invalid or changed IDD (rebuild needed?), ActiveX added in dialog but not (correctly) installed etc.
Or perhaps you are mapping in the same .exe multiple dlls and there is a clash between resource IDs?
BTW, why new CAboutDialog and not
[code]
CAboutDialog dlg;
dlg.DoModal();
[/code]
Nuclear launch detected
|
|
|
|
|
How to show a Modal Dialog box while i am doing some manipulation to my data before showing it to a grid.
Do i have to start any thread for it .??
Or should I set any event for it..?
|
|
|
|
|
I'd say your options are threads or idle-time processing depending on your needs and goals.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Hi,
I need to run a process without showing to user, in background,
The application is not a MFC it is normal command window application.
I tried the way like settinf the STARTUPINFO like SW_HIDE. But this is not working.
Can someone help me.
Thanks,
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
As far as I know, a Console application always shows the console.
Try creating a windows application and hide the main window.
|
|
|
|
|
Why it is like that, is there any other way to hide the console.
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
Hey i got it we can hide the cosole application also.
we have to fill the STARTINFO structure correctly
like
STARTUPINFO si;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
//set the flags to tell application to use the startup info
si.dwFlags = STARTF_USESHOWWINDOW;
//set the window hide options.
si.wShowWindow = SW_HIDE;
Refere the link Running console applications silently
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
This code can hide console window on my system (xp sp3).
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
if (CreateProcess(NULL, _T("cmd.exe"), NULL, NULL, FALSE, 0,
NULL, NULL, &si, &pi)) {
WaitForSingleObject(pi.hProcess, INFINITE);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
|
|
|
|
|
Ya i got it.
Thanks for your response.
Thanks,
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
Hello,
I've created a new class MyComboBox, derieved from CComboBox. I need to hook CBN_DROPDOWN and CBN_CLOSEUP messages and I do it in this way:
LRESULT MyComboBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case CBN_DROPDOWN:
fn1();
break;
case CBN_CLOSEUP:
fn2();
break;
}
return CComboBox::WindowProc(message, wParam, lParam);
}
But that doesn't work. What can cause the problem?
|
|
|
|
|
|
LRESULT MyComboBox::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
switch((int)LOWORD(wParam))
{
case CBN_DROPDOWN:
fn1();
break;
}
return CComboBox::WindowProc(message, wParam, lParam);
}
I tried this already, but the problem still exists
|
|
|
|
|
Have you read this part?
This message is sent when the list box of a combo box is about to be made visible. <br>The parent window of the combo box receives this message through the <code>WM_COMMAND</code> message.
|
|
|
|
|
Why are you not implementating handlers for CBN_DROPDOWN and CBN_CLOSEUP ?
What version of Visual Studio are you using?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Visual Studio 2005 Standard Edition.
|
|
|
|
|
Dear Techies,
I created a dialog based TCP/IP server using CAsycScoket to handle multiple clients. Things are fine when multiple clients connect and exchange data. I have the port nos and addresses of all the clients stored in a structure. (using ::GetPeerName())
But when a client gets disconnected, I can't identify which one got disconnected.
I know the framework calls ::OnClose() function when a client gets disconnected. But how do I identify the client which got disconnected?
Please help..
Thank you..
|
|
|
|
|
If client disconnect without shutdown call, server cannot detect the client disconnected unill tcp timeout.
To solve such that situation, need some techniques like;
1) let client always call shutdown
2) implement application level keep alive mechanism
3) implement server a polling to client after some interval from last client access
4) server force cut client after non transmission interval
...
Consider 1), 4) is most cost effective and 2), 3) makes increase packets.
Choose suitable method(s) to your system and application.
|
|
|
|
|
Hi,
I have something like the following:
CObArray array1;
CObArray array2;
.....array2.Add(&array1); ....
.....
'CObArray::Copy' : cannot convert parameter 1 from 'CObject *' to 'const CObArray &'
How Can I get this done?
Thanks
sft
|
|
|
|