|
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
|
|
|
|
|
Check the prototype of CObArray::GetAt .
|
|
|
|
|
Thanks for pointing in the right direction.
I was doing
array1.Copy( (CObArray*)array2.GetAt(0)); I should have been doing *(CObArray*) instead. Does this make sense?
Thanks
sft
|
|
|
|
|
Hours of debugging have finally paid off, and I've learned that I can't do this:
class C {
C(void);
C(int iNum);
C(int iNum, BOOL bBool);
}
C::C(void) { C(0); };
C::C(int iNum) { C(iNum, FALSE); };
C::C(int iNum, BOOL bBool) { }; I couldn't find any documentation telling me I couldn't do it that way, but it was definately causing problems.
So, is there another way to do it, or do I have to either (a) duplicate the code or (c) call a "constructor method" like this:
class C {
public:
C(void) { constructor(0, FALSE); };
C(int iNum) { constructor(iNum, FALSE); };
C(int iNum, BOOL bBool) { constructor(iNum, bBool); };
protected:
void constructor(int iNum, BOOL bBool);
};
void C::constructor(int iNum, BOOL bBool) {
}; As always, any assistance, or indicators towards what to read, are greatly appreciated.
MZR
modified on Thursday, June 4, 2009 10:32 AM (forgot return type for C::constructor() )
|
|
|
|
|
That is fine. However make sure you don't need a hierarchy where the base class implements the (int,bool) ctor and the derivations can call it using the initialization list.
class base
{
protected:
base(int n, bool b);
};
class myclass : base
{
public:
myclass();
};
myclass::myclass():base(1,true){}
Also check out Scott Meyers book Effective C++ for things like this and much more.
|
|
|
|
|
|
Mike the Red wrote: I couldn't find any documentation telling me I couldn't do it that way, but it was definately causing problems.
Such as? I used your class like the following and the constructors behaved as expected:
void main( void )
{
C c1;
C c2(1);
C c3(2, TRUE);
}
"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
|
|
|
|
|
I guess he want like java constructor like these;
class A {
public A(int a, int b, int c) {
}
public A(int a, int b) {
this(a, b, 0);
}
public A(int a) {
this(a, 0, 0);
}
}
|
|
|
|