After “doing” MFC for eternity, I finally got puzzled by this. Using basic MFC wizard to create application I see that the client rectangle of the default view is not the actual size of the rectangle on the screen. It is much smaller. All the documentation I have ever read on the suject describe the view client are as the entire screen. So why does GetClientRect comes up with lesser top/ bottom values? Thanks for reading Vaclav
So why does GetClientRect comes up with lesser top/ bottom values?
Aside from the top value always being 0, lesser than what? Unless the window is borderless (e.g., desktop), it can't occupy the entire screen. Things like borders, scroll bars, captions, etc take up room.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
Sorry, that was suppose to be right dimension. I know about the frame / border, what I am asking are the right / bottom dimesions not being SAME as the actual view screen client dimensions. For example - when I build a new window, with frame, in the default view ( parent frame) and use the view client rectange ( of the default view area) to size it - these dimesions are not the same as the actual view area. They are smaller. I suppose I should get the new window dimesions AFTER it is maximized. Than it should show larger size than when originally sized to the client area. Vaclav
It needs to write string to the file.
But it Open file return FALSE, GetLastError() = 3.
m_File2Write.Open(webRes.strLocalFile, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite))
DWORD error = GetLastError();
The file does not exists, but I think it will create a file. I do not know why Open file falied.
Now I know why. Because there is the chararcter '-' in the file name. Such as 12-444.html
But if use the explorer to create file 12-444.html, it is ok. Why use CFile, it error?
As the other Richard points out you have not escaped your backslash characters in the string, so the actual string being sent to the Open() function contains invalid characters. The "\t" part of the string is replaced by a tab character by the compiler.
Programming is work, it isn't finger painting.Luc Pattyn