|
The syatem scrollbar is overrided, but it shows both of system amd myself. Can I kill the system's or hide it? Help me, please! Thank you!
|
|
|
|
|
Hi,guys!
I want to develop a COM control that can be used by other people.
First, i want develop a MenuBar using ATL,and then this MenuBar can be drag in other frame window.
I'm using vs 2005,how can i get this? Any tutorial articles or source code for this ?
Any help would be appreciate !
modified on Wednesday, August 12, 2009 1:48 AM
|
|
|
|
|
Hi, guys, I'm writing simple tool for interest, like managing softwares, file association or IE history.
But when I get into this field, I find there are many information stored in files or registry. Like "index.dat" or "HKLM\SOFTWARE\Clients".
So I want to know, where I can get more information about such thing( registry about shell )?
Thanks in advance.
|
|
|
|
|
You could start here for information on the Windows Registry. But please take note of the warnings about changing values inside the Registry, as it is easy to get it wrong and make your system unusable. Also try searching CodeProject and Google.
modified on Tuesday, September 8, 2009 5:58 PM
|
|
|
|
|
Thank you very much.
I'm one developer.
I try to MSDN/Google/CodeProject etc, when I encounter problems.
But I want one way to know what registry keys and values mean, such as how to set default browsers, how to change advanced UI of windows etc.
So I can solve problems more professional.
|
|
|
|
|
SpringLion wrote: I want one way to know what registry keys and values mean
Your question is beyond the scope of these forums. There are hundreds of registry keys and values but no standard work of reference to describe them all. Try this site for a start, and then when you have a single question about a specific registry key, come back here and post your question.
|
|
|
|
|
|
|
how to find Textbox value in the DirectUI
I did not find the use of API GetWindowText
|
|
|
|
|
DirectUI is completely undocumented, all you can hope for is that someone has reverse-engineered how that control works and posted about it on the net.
--Mike--
Dunder-Mifflin, this is Pam.
|
|
|
|
|
I have legacy code written under VC6 which use a lot of auto_ptr. And, have problem to build it under VS2008/VC9, becouse it's put auto_ptr in vector, that isn't accepted in VC9. Then, I want share_ptr to replace it. Can I just replace them at where they are declared?
Thanks,
Hawk
|
|
|
|
|
hawkgao0129 wrote: I want share_ptr to replace it. Can I just replace them at where they are declared?
Yes.
The difference between auto_ptr and shared_ptr is that auto_ptr passes ownership around like a token, and it's possible for ownership to expire (and the object to be deleted) before you expect.
shared_ptr is like lots of people holding a plate - the plate doesn't break until everyone's let go of it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
In legacy code, it employed auto_ptr::release() to free resource. When i use shared_ptr, how to release resource? use "delete" keyword to call destructor of shared_ptr?
|
|
|
|
|
No - use the reset()[^] method.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
you mean shared_ptr::reset(0)? Why tr1::shared_ptr doesn't have an explicit release() function? Do auto_ptr::reset(0) and auto_ptr::release() have the same mean?
|
|
|
|
|
Oh, shared_ptr::reset() can be called without argument. That means set it become empty. Maybe equal to auto_ptr::release()
|
|
|
|
|
hawkgao0129 wrote: Maybe equal to auto_ptr::release()
For your purposes, yes - they're equivalent
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have been wondering what the logic was behind the fact that the ifstream read method sets the eofbit as well as the failbit on a read failure, but can find no explanation. I can see that if you are just checking for EOF in a loop then setting the eofbit will stop any future reading, but this also hides the cause of the error. That is if we have not actually reached the end of the file, then there is nothing to tell us this fact. If you try to read a 25k file and the codecvt do_in method returns error after reading only half a line of text, then both bits are set and there is nothing to tell us that we have not just read the entire file. I can easily hack my way around the problem, but the fact that I would have to do that is ridiculous.
Does anyone have an idea or explanation for this behavior?
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Looking at the C++ standard specification for read (27.6.1.3 paragraph 28):
Characters are extracted and stored until either of the following occurs:
—n characters are stored;
—end-of-file occurs on the input sequence (in which case the function calls setstate(failbit|eofbit), which may throw ios_base::failure(27.4.4.3)).
There are two outcomes - either we can read n characters or not. If not, failbit and eofbit get set.
BTW - the idiomatic way (from what I'veseen) to loop on a stream isn't to check for eof, it's to check the stream status like so:
std::ifstream f(...);
while(f)
{
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Here is that basic problem, the while loop works great but the test calls an over-ride that is just checking if the EOF has been reached (overloaded … etc.). Which makes since accept when that is not true? If an error occurs while reading, you need to know that is what happened; just saying that you have reached the EOF, when untrue, gives the wrong information. An error has occurred, true, but it is not because you reached the end of the file (EOF). This little piece of information is very important. One work around, which applies to C as well, is to get the size of the file before reading it; is to compare the number of bytes read as opposed to the size of the file. The main difference between C and C++ (I may be wrong) is that a read error can occur without reaching the EOF, so you need to check for both while reading a file. I will grant that if you try to read past the EOF that it is an error and you have reached the EOF. But before reaching the EOF, only an error flag should be set; indicating that a read occurred. If it sets the failbit and the eofbit every time an error occurs, it is self defeating and is lying to the developer
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
[edit]Pressed 'Post Message' with no message - DOH![/edit]
If the failbit is set, you know reading terminated because of an error. eofbit set alone is an indicator of end-of-file. Sounds like you just need to change the priority of checks round a bit?
|
|
|
|
|
If an error occurs before the number of elements requested is read then both eofbit and failbit are set. This is done whether you reach the end of file or not, because all the read method knows is the number of elements read and is therefore guessing.
amountRead = rdbuf()->sgetn(pElements, amountRequested);
GCount += amountRead;
if( amountRead != amountRequested )
State |= eofbit | failbit;
_St |= eofbit | failbit;
State |= ios_base::eofbit | ios_base::failbit;
__err |= (ios_base::eofbit | ios_base::failbit);
I do know it terminated because of a read error, but since we can not know how many characters the encoded source data represents, we can not avoid the error. Therefore we do not know if it is an attempt to read the EOF or an encoding error.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone
modified on Tuesday, July 14, 2009 2:36 PM
|
|
|
|
|
Hello
Following is my code to display CHEVRON
pdbi->dwModeFlags = DBIMF_NORMAL|DBIMF_BKCOLOR | DBIMF_USECHEVRON |DBIMF_BREAK;
By using this code, chevron is display with Icons on Windows Vista with IE7 , but it not display Icons in IE6 for Windows XP.
Is there any othere Flags needs to set for Windows XP.
Thnaks in Advance
AM
|
|
|
|
|
This should work:
if (pdbi->dwMask & DBIM_MODEFLAGS) pdbi->dwModeFlags = DBIMF_USECHEVRON | DBIMF_BREAK;
|
|
|
|
|