|
We have an application written in VC 6, that works well on Windows 2000, but when running on XP the modeless status diaglog that displays the progrees of the operation doesn't seem to refresh or return to top after the operator returns from a screen saver.
The status bars continue to updte as far as we can tell, but the application appears to lose focus of the modeless dialog until the operation is complete. When the operation finishes, THEN the status screen displays with all status bars compete at 100%, and a the Afxmessege Box appears.
How can I get the application to return focus to the status screen when returning from the screen saver?
Anyone have any suggestions?
Snaggles
|
|
|
|
|
|
Try to set the modeless as top window with SetForegroundWindow()
you can also WM_NEXTDLGCTL message it is sent to a dialog box procedure to set the keyboard focus to a different control in the dialog box.
Vikas Amin
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Hi,
I have an application(MFC), it needs to send some data (XML 20/25kb) to some online entity(some online script or service) and that online entity will parse the XML query some Database and return results to the MFC application.
i just need to know what is the idea scenario under these circumstances should i use some script or service or query the database directly
please suggest
Thanks
C++ where friends have access to your private members !
|
|
|
|
|
|
Hello there, some one help me ?
How can i configure my Visual Studio 8 to solve the problem indicated by the above message ?
C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h(4575) : error C3861: '_beginthreadex': identifier not found
tanks for help ...
Ps: Sorry by my english, i´m Brasilian
|
|
|
|
|
You don't need to configure anything, just include the appropriate header file: procces.h (as described in the documentation[^] ).
|
|
|
|
|
See here. You are not including the process.h file.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
I am using a thread for which I am sending the below mentioned structure as parameter. pls advice
error C2440: '=' : cannot convert from 'const class abcDomain::Scope *const ' to 'class abcDomain::Scope *'
.h
declaration
virtual bool searchABCByAttributes()const;
typedef struct THREADSTRUCT_SCOPE
{
Scope *_this;
}THREADSTRUCT_SCOPE;
.CPP
bool Scope::searchABCByAttributes()
{
THREADSTRUCT_SCOPE *_param= new THREADSTRUCT_SCOPE;
_param->_this = this;
....
|
|
|
|
|
Your function is declared as constant, so it means that the this pointer is const too. And you are trying to assign it to a non-const variable, which is illegal. So, remove the constness of the function and it should be fine.
|
|
|
|
|
Missed a const in the definition of Scope::searchABCByAttributes() ?
.h
declaration
virtual bool searchABCByAttributes()const;
.CPP
bool Scope::searchABCByAttributes()
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Sorry it is my mistake, pls find below the correct one. I want keep the const, is there any work around...
.hdeclaration
virtual bool searchABCByAttributes()const;
.CPP
bool Scope::searchABCByAttributes()const
|
|
|
|
|
There's a solution but it is really ugly: you can remove the constness of the this pointer by using a const_cast. But it doesn't make any sense because you declared your function as const. Why would you do that if you remove the constness inside it ?
Another point: why are you putting the this pointer inside a structure if you only pass that pointer ? Why don't you pass it directly to your thread function ?
|
|
|
|
|
I am putting it inside sturct, Becase I want to pass it as parameter to Thread along with other attributes
|
|
|
|
|
The basic problem is you are assigning a const pointer to a non-const pointer . Well, if you want to keep the consts in the function signature, then possible get arounds are
1) Make the Scope *_this; as const. The only problem is since its a const member, you've to initialize it by constructor. So your code snippet will change like this -
typedef struct THREADSTRUCT_SCOPE
{
THREADSTRUCT_SCOPE( const Scope* ptr )
: _this( ptr )
{}
const Scope *_this;
}THREADSTRUCT_SCOPE;
And allocate it like this,
bool Scope::searchABCByAttributes()
{
THREADSTRUCT_SCOPE *_param= new THREADSTRUCT_SCOPE( this );
...
}
1) You can also use cstyle casting or const_cast to remove the constness. But its not recommended. It can be done as follows. Just FYI.
_param->_this = (Scope*)this;
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
but now I had #error WINDOWS.H already included. MFC apps must not #include <windows.h>
|
|
|
|
|
Well, thats your next compiler error to fix!
As the error says - check whether windows.h is included in your project and remove it.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
If I remove it these two error flashes
but really ";" was not missing
.h
THREADSTRUCT_SCOPE *_param;
static UINT WorkerThread(LPVOID param);
: error C2146: syntax error : missing ';' before identifier 'WorkerThread'
: error C2061: syntax error : identifier 'LPVOID'
|
|
|
|
|
Instead of windows.h , include StdAfx.h header. Add it to the beginning of file before all other #includes.
#include "StdAfx.h"
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
it gives new error, i belive some wrong ...........
ilapeeimpbatch.hh(665) : fatal error C1004: unexpected end of file found
|
|
|
|
|
1) Check the points described here - http://msdn.microsoft.com/en-us/library/4exw7xyc(VS.71).aspx[^]
2) Since the error is from header file, did you forget to put semi column after the class declaration?
If these points didn't resolve issue, please post your entire header file.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I am new to win 32 sdk programming. Please tell me how to load and display an existing bmp image file in my window which is also created dynamically.Please do help me out.
Thnx in advance.
|
|
|
|
|
|
Thnx for the help.I'll chk out the link.Thnx once again.
|
|
|
|