|
Hi ,
hope this will help sorry for replying late .
CProgressDlg prgDlg;<br />
prgDlg.Create();<br />
prgDlg.SetRange(0,100);<br />
<br />
File_count_line.seekg (0, ios::end);<br />
int length_total_line = File_count_line.tellg();<br />
int nLoop = length_total_line/length_one_line;<br />
File_count_line.seekg (0,ios::begin );<br />
<br />
int length_one_line = File_count_line.tellg();<br />
<br />
double nPerc = (double)((double)length_one_line/length_total_line)*100;<br />
prgDlg.SetPos((int)nPerc);
Regards,
FarPointer
-- modified at 11:01 Sunday 2nd April, 2006
|
|
|
|
|
ariesaloksingh wrote: Sir i had tried that but that's not working.
If you don't manipulate the progress bar it always looks disabled. Well the progress bar does only give visual feedback to the user and nothing else and user cannot interact with the progress bar. So check if progress bar is enabled before manipulating it.
Nibu thomas
Software Developer
|
|
|
|
|
|
i am working on a dialog base application there is a main dialog in which several button on one button i am calling another dialog which start downloading file using a thread and evry thing successfully done
but this dialog also have "cancel" button in between downloading if i clicked cancel button on this button I handle a event and call suspend thread and enddialog function but this time it give runtime error and also when i use terminate thread there is same problem.
if anybody have idea about this,please tell me what should i have to do.
Bankey Khandelwal
Software Engineer
|
|
|
|
|
Never call SuspendThread - Unless you're a threading expert it's just too dangerous. This is a common threading error, up there with calling TerminateThread . Here's a common failure scenario of how calling SuspendThread causes problems:
1- The worker thread enters a Win32 API function, this function calls EnterCriticalSection .
2- Another thread calls SuspendThread and stalls the worker thread before it can call LeaveCriticalSection .
3- Another thread calls the same API, when it calls EnterCriticalSection it stalls waiting form the critical section to be released - It never is.
Any thread that calls this API now hangs.
This kind of bug is real, hard to reproduce and hard to find. Failure will be of a different nature depending on what the worker thread is doing at the time it is suspended. SuspendThread , TerminateThread and friends are only intended for experts and debuggers - Mere mortals should not use them.
Steve
|
|
|
|
|
but wright now i have to solve this bug, so can you u guide me what should i use for get rid of this bug
Bankey Khandelwal
Software Engineer
|
|
|
|
|
I'm not sure of the exact nature of your problem, but I would start by removing calls such as SuspendThread and TerminateThread - I'm not just making this stuff up, these two API really do cause havoc.
Can you give any details of the runtime error?
Steve
|
|
|
|
|
In your handler for the cancel button, you should set a flag (or an event) that can be read in the worker thread that tells it you have cancelled.
Inside the thread, have it finish whatever it's doing and simply allow itself to exit after all necessary cleanup. Just before it exits, it can set another flag (or event) to signify that it is exiting the thread
Back in the main thread, wait for the signal from the thread that it is exiting, then you can safely let the main thread die (by calling your EndDialog).
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I am trying to play a flash file on the dialog box using picture control or directly on dialog box without using activex control.Can any one please help.....
thanks in advance
|
|
|
|
|
The flash play is an ActiveX control.
Steve
|
|
|
|
|
The other way around: link the flash file in a HTML page. Then Open the HTML page in your Dialog (again using IE activex ). This time your IE is gonna use the Flash Activex control.
VuNic
|
|
|
|
|
one type of fonts is called "true-type-font", what are the names of other types of fonts? what are differences between them? any samples to create fonts by C++ (prefer VC)?
thanks
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
|
How to associate a scrollbar with image
|
|
|
|
|
u want to scroll the image by scrollbar, don't u?
if yes and u use a dialog for image, just add 2 scrollbar beside the image area, when user clicks scrollbar, you "scroll" your image.
there are many ways to scroll an image, popular way is to display (i.e. BitBlt() or StrechBlt()) different part of the image according to scroll-position.
u should disable WM_ERASEBKGND message for better performance (no flash).
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
|
Hi..
I have an SDI application in form view. When am inserting a new dialog with either CDialog as base class or CFormView as base class, how I can put that dialog under the same frame as a child, just like the first one. Please help me
|
|
|
|
|
looking for samples of CSplitterWnd in VC CD, which is what u need.
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
Given a HCURSOR handle, how can one tell if it is an animated cursor (loaded from an .ani file or RT_ANICURSOR resource) or not?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
i'm a novice with a working c++ dialog program using VISUAL C++ IDE (version 6) that asks the user for path to a file which i process. How do i get a tree view of 'my computer' folders/files just like 'windows explorer details view' so i can select a range of files to process, one at a time?
|
|
|
|
|
MFC? Use CFileDialog or else use GetOpenFileName() . Be sure to include OFN_ALLOWMULTISELECT as one of the flags and make sure that OPENFILENAME::nMaxFile and OPENFILENAME::lpstrFile are set up correctly.
http://www.codeproject.com/dialog/pja_multiselect.asp[^]
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
ok, thanks; looking up your keywords in the IDE help.
|
|
|
|
|
I think there is a file dialog control you can use. you can use that to make your life easier. I,m a newbie too but im using C# at the moment. ^_^
|
|
|
|
|
thanks, i'm slogging through the IDE's HELP section. This is pretty blasted complicated.
|
|
|
|
|
Hello!
I use an ActiveX component, that have function, that creates new object and returns LPDISPATCH pointer. In MSDN i'm read that IDispatch::Invoke provides access to properties and methods exposed by an object. But there is so many parameters, strange structs, etc... Can somebody explain me that or give URL with guid for dummies or give sample?
|
|
|
|