Click here to Skip to main content
15,905,686 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dwDesiredAccess in CreateFile API Pin
Stuart Dootson25-Aug-09 21:06
professionalStuart Dootson25-Aug-09 21:06 
QuestionLNK1107 Pin
MozhdehQeraati25-Aug-09 18:39
MozhdehQeraati25-Aug-09 18:39 
AnswerRe: LNK1107 Pin
Code-o-mat25-Aug-09 20:45
Code-o-mat25-Aug-09 20:45 
GeneralRe: LNK1107 Pin
MozhdehQeraati25-Aug-09 21:31
MozhdehQeraati25-Aug-09 21:31 
AnswerRe: LNK1107 Pin
Stuart Dootson25-Aug-09 21:08
professionalStuart Dootson25-Aug-09 21:08 
GeneralRe: LNK1107 Pin
MozhdehQeraati25-Aug-09 21:32
MozhdehQeraati25-Aug-09 21:32 
GeneralRe: LNK1107 Pin
Stuart Dootson25-Aug-09 22:08
professionalStuart Dootson25-Aug-09 22:08 
QuestionOnSize [modified] Pin
zhenek9125-Aug-09 17:06
zhenek9125-Aug-09 17:06 
A question is such:overload a function OnSize(). I want, that buttons at the stretch of basic window either upwards or to the right saved the positions in relations to the overhead and right edges of main window.

Code:
void CMobileTISDlg::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);
	if(Flag)
	{
		 int nCount = ResData.size();
        for(int i=0;i<nCount;i++)
        {
            GetDlgItem(ResData[i].nID)->SetWindowPos(&wndTop, cx - ResData[i].aPoint.x, cy - ResData[i].aPoint.y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
        }
	}
}


ResData is a vector, containing structures
Код:


struct  ResizeStruct
{
	CPoint aPoint;//left overhead corner of button
	UINT nID;//ID of button
};


Filling of structure:

void CMobileTISDlg::SetResData(UINT nID)
{
    ResizeStruct Res;
    CRect rc, rcForm;
    GetDlgItem(nID)->GetClientRect(&rc);
    GetClientRect(&rcForm);
    Res.aPoint.x = rcForm.right - rc.left; Res.aPoint.y = rcForm.bottom - rc.top;
    Res.nID = nID;
    ResData.push_back(Res);
}


A problem is such: at testing of the program the buttons appear in one place in the left corner of the program.
Started a debugger? top and right of Rect rc in function SetResData() are always equal to the zero. What is my error in?

modified on Wednesday, August 26, 2009 1:56 AM

AnswerRe: OnSize Pin
Code-o-mat25-Aug-09 20:28
Code-o-mat25-Aug-09 20:28 
AnswerRe: OnSize Pin
Cedric Moonen25-Aug-09 20:32
Cedric Moonen25-Aug-09 20:32 
GeneralRe: OnSize [modified] Pin
zhenek9125-Aug-09 20:39
zhenek9125-Aug-09 20:39 
QuestionAdding Checkboxes to a list control in every column Pin
Member 470944425-Aug-09 13:00
Member 470944425-Aug-09 13:00 
AnswerRe: Adding Checkboxes to a list control in every column Pin
Code-o-mat25-Aug-09 20:34
Code-o-mat25-Aug-09 20:34 
AnswerRe: Adding Checkboxes to a list control in every column Pin
David Crow26-Aug-09 3:09
David Crow26-Aug-09 3:09 
GeneralRe: Adding Checkboxes to a list control in every column Pin
Member 470944426-Aug-09 4:03
Member 470944426-Aug-09 4:03 
QuestionRe: Adding Checkboxes to a list control in every column Pin
David Crow26-Aug-09 4:09
David Crow26-Aug-09 4:09 
AnswerRe: Adding Checkboxes to a list control in every column Pin
Member 470944426-Aug-09 4:14
Member 470944426-Aug-09 4:14 
GeneralRe: Adding Checkboxes to a list control in every column Pin
David Crow26-Aug-09 4:17
David Crow26-Aug-09 4:17 
GeneralRe: Adding Checkboxes to a list control in every column Pin
Member 470944427-Aug-09 4:32
Member 470944427-Aug-09 4:32 
GeneralRe: Adding Checkboxes to a list control in every column Pin
David Crow27-Aug-09 4:43
David Crow27-Aug-09 4:43 
Questionvisual c++ MFC reading access data file Pin
Merlin Vilhauer25-Aug-09 12:20
Merlin Vilhauer25-Aug-09 12:20 
AnswerRe: visual c++ MFC reading access data file Pin
Adam Roderick J25-Aug-09 18:09
Adam Roderick J25-Aug-09 18:09 
QuestionNeed a guideline of way to start my new challenge Pin
ayeosq25-Aug-09 5:54
ayeosq25-Aug-09 5:54 
AnswerRe: Need a guideline of way to start my new challenge Pin
David Crow25-Aug-09 7:42
David Crow25-Aug-09 7:42 
AnswerRe: Need a guideline of way to start my new challenge Pin
Hristo-Bojilov25-Aug-09 8:04
Hristo-Bojilov25-Aug-09 8:04 

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.