Click here to Skip to main content
       

C / C++ / MFC

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: MFC client view rectangle size?memberVaclav_Sal16 May '12 - 5:55 
CScrollView::OnInitialUpdate() ... works   only in scroll view. I have tried that in plain CView derivative. VC complier said so.
 
As far as starting maximized – that was not the question. I   said using wizard created default view.
Sorry.
GeneralRe: MFC client view rectangle size?memberFlaviu216 May '12 - 7:40 
Perhaps I don't give a reasonable ideea, but you can look where MFC implement CScrollView::ResizeParentToFit(..) and reproduce the code ...
AnswerRe: MFC client view rectangle size?memberDavidCrow16 May '12 - 7:07 
Vaclav_Sal wrote:
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


GeneralRe: MFC client view rectangle size?memberVaclav_Sal16 May '12 - 8:52 
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
AnswerRe: MFC client view rectangle size?memberFlaviu216 May '12 - 7:44 
Another ideea is to send to the view a menu->window->tile message, and your view will spreadsheet along mainframe ...
GeneralRe: MFC client view rectangle size?memberVaclav_Sal16 May '12 - 8:53 
Good idea, but still does not answer the original questio. SOrry.
QuestionCFile Open failed GetLastError = 3 [modified]groupyu-jian16 May '12 - 2:43 
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();
return -1L;
}
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?

modified 16 May '12 - 9:03.

AnswerRe: CFile Open failed GetLastError = 3mvpCPallini16 May '12 - 3:00 
WinError.h:
 
//  The system cannot find the path specified.
 
OK the file does not exist and you want to create it, but what about its folder?
Veni, vidi, vici.

GeneralRe: CFile Open failed GetLastError = 3groupyu-jian16 May '12 - 3:05 
I know 3 means can not find the path, but I donot know why.
GeneralRe: CFile Open failed GetLastError = 3mvpCPallini16 May '12 - 3:21 
I would check with the debugger the runtime value of webRes.strLocalFile.
Veni, vidi, vici.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 23 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid