|
Is it an editable combo box? If so, you probably should subclass the edit field instead of the combo itself. Also you could try overwriting PreTranslateMessage for the combo, maybe those messages cross it before trabslation, am not sure.
> 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. <
|
|
|
|
|
Dear All,
I have resource sharing issue in my MFC programming. Below, I will describe the scenario.
I am using VC++ 6.o version
I have a dialog(modeless) based application.
Main dialog box has a Button( say "Button1" ) with OnButton1(), that will call member function DisplayChildDialog()
I have a worker thread also, that will call DisplayChildDialog() using PostMessage() of main dialog.
DisplayChildDialog() will dispaly a child dialog(modal). Child dialog's object is created locally in DisplayChildDialog().
So DisplayChildDialog() will always called from the GUI thread.
Scenario:
When I clicks on "Button1", OnButton1() will call a member function DisplayChildDialog() and a child dialog(modal) will appear.
This time worker thread will also call DisplayChildDialog() using PostMessage() of Main dialog.
When I click on "Button1" DisplayChildDialog() will also call from worker thread using PostMessage(). of the main dialog. So two dialogs will appear simultaniously.
To avoid this situation I made the second caller of DisplayDialog() to enter in a MessageLoop, and will check a flag that will infrom whether the first caller has left the DisplayChildDialog() or not.
I wrote the message loop in DisplayDialog() like this.
DisplayDialog()
{
if( CChildDlg::m_bDisply == true )
{
while( GetMessage( &stMsg, 0, 0, 0 ))
{
TranslateMessage( &stMsg );
DispatchMessage( &stMsg );
if( false == CChildDialog::m_bDisply )
{
OutputDebugString( _T( "### Message loop false************************" ));
return;
}
}
}
CChildDlg::m_bDisply = true;
CChildDlg objChild;
objChild.DoModal();
CChildDlg::m_bDisply = false;
}
But this will work 5 or 6 times correctly. But after that, when I clicks on "Button1", the first caller of DisplayDialog() will terminate before showing the dialog box it will just make CChildDlg::m_bDisply = true. So the second caller will enter in Message loop and never exit.
I tried this too instead of above given message loop:
while( CChildDlg::m_bDisply && WaitMessage())
{
AfxGetApp()->PumpMessage();
}
But both given same result..
Please help me.
|
|
|
|
|
How can it terminate without showing the dialog and leave your flag set to true?
> 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 All,
I need to make "make File" while building my code in VS 2005. please guide me
Thanks
Bankey
|
|
|
|
|
what makefile u r talking about.will u explain in detail?PLease.
|
|
|
|
|
actually i need to build VC++ Project from command prompt...so i think that, we can do it by using "MakeFile".
|
|
|
|
|
There is a simpler way.
Just type "devenv <.sln filename>" or "devenv <.vcproj filename>"
You need to ensure that devenv is in the path.
For this you can take the Visual Studio 2005 Command Prompt .
You will find the link in All Programs -> Microsoft Visual Studio 2005 -> Visual Studio Tools .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your response. your reply is correct i am able to build but i want to know...is there any to make "MakeFile" from VS 2005 as VC6.0.
once i have generate Makefile from vc 6.0 but i am unable to generate "makefile" from VS 2005.
|
|
|
|
|
That's because Microsoft took that functionality out.
Why do you need a makefile? What's wrong with running Visual Studio @ the command-line to build your project as the previous answer said?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
you can create a makefile yourself or use the mkmf tool.
A make file includes the paths, includes, blah blah....
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Hello Friends
I converted one window based application from vs2002 to vs2008.Whenever I open a dialog and when i move my mouse on that dialog then dialog beocmes invisible only if mouse goes on some controls like(button,checkboxes).
Please suggest me some solution.
Thanks & regards
Yogesh
|
|
|
|
|
what is your exact problem?
do you want to hide the dialog or do you want to prevent that dialog hiding?
please explain your problem in detail.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
I want to prevent that dialog hiding Sir ji.
|
|
|
|
|
ok ji,
did you try to debug ji?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
On my Mouse Move ,I m not doing anything related to that hiding of dialog .
|
|
|
|
|
but it seems that, you are doing some thing there.
first try to comment the whole code in on mouse move and see what happens?
and, do you observe the dialog hidden or killed?
if it is hidden, then is it again coming back in any other event?
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
On click of a button,it is appearing but when i move there on dialog,it hidden then again if i click button then dialog comes again.
|
|
|
|
|
Is it a child dialog? Is it covered by other window or control?
|
|
|
|
|
|
I think you should verify if this child dialog is covered by other windows or controls 
|
|
|
|
|
Yes sir ji,This child window is haniv some controls like buttons,checkboxes,spinners and it is getting hidden whenever my mouse comes on that controls (checkboxes,buttons).
|
|
|
|
|
I got the solution.
Thanks for ur help.
|
|
|
|
|
yogeshs wrote: I got the solution.
good,
but can you post your solution here, such that, others who have this same problem need not suffer again.
all the best.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
Hi all,
I have created a program which can scan windows update, download updates, install updates.
But its scan results defer from that of MBSA, it always gets more results. After I checked it, I found that it involves "SupersededUpdateIDs". MBSA often removes update items that are superseded by others. However, this is not always true. After I improved the program according it, I indeed reduced the difference between MBSA and my program, but still some difference. Can anyone tell me how MBSA dealed with the scan results? I mean, what MBSA has done with the scan results according to "SupersededUpdateIDs" or anything else?
Also, When I use "download" and "install" function in my program, sometimes there are errors, like "0x80240024"(when download), "4"(when install) HRESULT value returned. I want to known if it concerns with my os setting or something else. So can anyone tell something about this?
all above.
thanks a lot 
|
|
|
|
|
In my code i have too much comparison of strings, is it not a better idea to associate an enum for each string and compare them ?
Will this be faster or will it be same as string comparison ?
Thanks in advance. 
|
|
|
|