|
If the code is in the main thread, then your application won't be able to respond to GUI events (thus the 'Not Responding' message and the window will stay blank). You need to start your download in a separate thread for that.
|
|
|
|
|
Hi
thanks for giving me reply
But actually I am very new to VC++ programming so I don't know thread programming. So can you please provide me the whole details that what should I do to go ahead.
Thanks again!!!!
|
|
|
|
|
You can have a look here[^]. There are a lot of articles about this subject.
|
|
|
|
|
Oh!!!!
Thanks for your reply
|
|
|
|
|
Jigish Shah wrote: So can you please provide me the whole details that what should I do to go ahead.
Read here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Actually my problem is like in my application client can download updated version of exe from our server.
We have made success to reach this part. But when user start downloading new exe after few seconds the TASKMANAGER window shows the message Not Responding instead of running.
So, this is the thing where I struck. I hope you will understand my problem.
if you find any type of solution than please tell me.
Thanks
|
|
|
|
|
James_Programmer wrote: So, this is the thing where I struck. I hope you will understand my problem.
I understand fully. Cedric has explained why and offered a solution. Did you implement it?
Check out SendMessageTimeout(hWnd, WM_NULL, ..., SMTO_ABORTIFHUNG, ...) for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
The "Not Responding" message appears if your application does not pump messages for a certain amount of time (I believe it is 5 seconds), and then a user tries to interact with it by activating it, clicking on it, etc.
The background thread suggestion(s) are the way to go, I just wanted you to understand exactly why that message appears.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi James,
Thanks for giving me reply but as per you told that I have to pump message continuously to keep running my application So, How can i pump message in background to do this?
I have used Spawnl() function in my application to replace my older exe to new one.
I hope you will understand the problem which I have faced.
Thanks again!!!!
|
|
|
|
|
You do not pump messages in the background, you download the updated EXE in the background. You do this by creating a background thread and having it do the FTP transaction, and your primary thread continues to pump messages and operate normally.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
oh!!!
james thanks for giving your valuable time to give solution of my problem
Thanks!!!!!!!!
|
|
|
|
|
I have a window where 3D diagrams are drawn.When the window is maximized the
diagram appears correctly.But when it is minimized or if we change the size of the window the diagram is getting clipped.
Sometimes when the diagram which is clipped originally is displayed without clipping when we change the size.
I need code for resizing the diagram(clipped and unclipped) according to the window size.
plz help...
Thanks
|
|
|
|
|
That depends a lot of what you are using to draw your 3D diagrams. The only thing I can say is that you need to resize the 'window' (or the control) in which they are drawn.
|
|
|
|
|
I have compute the character width by using GetTextExtent() but i get wrong value.
The code is: -
///////in fuction1
//setting the character width
m_nCharWidth = dc.GetTextExtent(CString(pChar->GetCharacter()),1).cx;
////////in fuction2
//setting the character width by current character
m_nCharWidth = m_oMemDC.GetTextExtent(CString(m_pChar->GetCharacter()),1).cx;
-----m_oMemDC is created as follow: -
m_oMemDC.CreateCompatibleDC(&dc);
Why these two differs i dont know please help me on this topic?
Thank u
Hi
|
|
|
|
|
GetTextExtent() uses the font currently selected into the device context in it's calculations. You have to make sure both device contexts have the same font in them in order to get the same result.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
I have one sheet which is inherited CPropertySheet, I have added 3 page (inherit CPropertyPage) in to the sheet. How to set caption text in each sheet?
I used SetWindowText and SetDlgItemText but not success
Thanks.
Papais
|
|
|
|
|
|
Override the OnSetActive method for the property page and then do this
MyPropSheet* parent = (MyPropSheet*)GetParent();
// Set Title
parent->SetTitle( " This is the title for my property page " , 0 );
I hope this helps...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi,
I'm using a RichEditCtrl in a VC++ 6 Mfc application. The RichEdit is Readonly an I'm pasting text inside this control by ReplaceSel(). The text I'm inserting contains several lines which are separated by CR+LF. If I use GetwindowTextLength() I get the correct length for the text, which means, all CR+LF are counted. But if I use e.g. LineIndex(), which should retrieve the length of a specified line, only the text and the CR is counted. How can I tell the Richedit that it should count the LF also. There exists a flag GT_USECRLF, but I don't know how to use it.
Thanks for all answers
Juergen
|
|
|
|
|
Hi,
How do I delete printer Icon from system tray...
SAJI
|
|
|
|
|
Use Shell_NotifyIcon() to delete the tray icon.
then the problem is how to get the HWND and id number associate with the icon.
Maybe TB_GETBUTTONINFO message is useful for get the HWND and id.(tray is a toolbar32 control,you find it in spy++).
Hope it will help you.
|
|
|
|
|
i searched WriteIconToICOFile( LPICONRESOURCE lpIR, LPCTSTR szFileName );
but how conver HICON to lpIR?
thanks..
|
|
|
|
|
Have you had a look at this: ^-^
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
HOW WHAT wrote: WriteIconToICOFile(
This is not a standard API. Refer article[^], where it is defined and used.
|
|
|
|
|
WriteIconToICOFile is IconPro 's function
|
|
|
|