i want to display a progress bar in listview control as a subitem.
the progress bar would continously be updated and i shouldnt use any images.
i am using vc++ 2005 and i am not using MFC.
i am using win32 programming.
i know this can be done using custom control but if any one knows more than that please reply (i.e with a smaple code)
The only way that would work would be to change the declarations to:
char i = "abcd";
char j = "ABCD";
See here for the difference in why one can be changed and not the other.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
You should never loose sight of the code generated by the compiler. In your case the Compiler will include two char arrays into the excecutable, namely "abcd" and "ABCB" The fact that you Tyedefed them as myString has confused you more than the compiler. You cannot copy i to j, because both are in memory reserved for string constants. In other words: Both are in 'read only' memory. I strongly suggest that you get a copyof the excelent book written by Brian Kernighan and Denis Ritchie about the 'C' language (Never mind CPP). And rephrase the question above after reading these books.
If you do the appropriate amount of study,you will realise that in the above example code fragments, memoryleaks are not even close to being an issue.
Not if you don't read the sticky posting called "how to get answers", and the line that says "please use meaningful subjects". I've yet to see someone post a message with a subject of "ignore this - I don't need any assistance".
But I'll be nice anyway..
1/ The numbers are different, so there will be differences.
2/ Less trivially, the first example just calls the constructor. The second example makes two objects, (obj, and a temp one), then copies temp to obj, then destroys the temp object.
If it's CPoint, then it's trivial. If it opens / closes databases, does a network operation etc, then the difference could be HUGE.
Update: See CPallini's and my conversation later. Short version: No actual difference between the two bits of code (except the numbers!)
(I've messed up both copy constructor and assignment operator to detect it)
and IMHO skipping the temporary object construction and the assignment operator is really weird, but I don't know what the C++ standard requires.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
Is there a Windows API or a method which can convert FILE* to HANDLE of a file or convert HANDLE to FILE* ???
The background of application :I want to monitor the I/O of a special file by hooking WriteFile and the file be opened by 'fopen'.In addition, I can`t modify the function form 'fopen' to 'CreateFile'. Therefore I can`t know which handle of file should be monitored according to the first parameter of WriteFile.So I hope there is a way that can convert HANDLE or FILE* to another.
and kept debugging into functions until I found the C runtime using an array of information called _osfhnd which stored the mapping between stream opened by _tsopen and HANDLE. This stream is the _file member of FILE.