Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Determining the type of a member variable Pin
#realJSOP13-Dec-03 9:36
professional#realJSOP13-Dec-03 9:36 
GeneralRe: Determining the type of a member variable Pin
Ian Darling13-Dec-03 10:12
Ian Darling13-Dec-03 10:12 
Generalcapture output Pin
thes3cr3t113-Dec-03 8:53
thes3cr3t113-Dec-03 8:53 
GeneralRe: capture output Pin
BaldwinMartin13-Dec-03 9:05
BaldwinMartin13-Dec-03 9:05 
GeneralRe: capture output Pin
thes3cr3t113-Dec-03 9:29
thes3cr3t113-Dec-03 9:29 
QuestionRegistry Question ? Pin
BaldwinMartin13-Dec-03 8:47
BaldwinMartin13-Dec-03 8:47 
AnswerRe: Registry Question ? Pin
BaldwinMartin13-Dec-03 14:40
BaldwinMartin13-Dec-03 14:40 
GeneralPutting a view in a dialog box Pin
#realJSOP13-Dec-03 8:37
professional#realJSOP13-Dec-03 8:37 
Well, I looked around, and everyone seems to think this is hard to do, but here's what I came up with:

BOOL CD3PlayRecsDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	CRect frameRect;
	GetDlgItem(IDC_STATIC_VIEWFRAME)->GetWindowRect(&frameRect);
	m_pView = new CDialogView(NULL);
	ScreenToClient(&frameRect);

	DWORD winStyle = WS_CHILD | WS_HSCROLL |  WS_VSCROLL |  WS_VISIBLE | WS_BORDER;
	m_pView->Create(NULL, NULL, winStyle, frameRect, this, AFX_IDW_PANE_FIRST+1, NULL);
	m_pView->SetScrollSizes(MM_TEXT, CSize(100,100));
	m_pView->MoveWindow(&frameRect, TRUE);

	return TRUE;  // return TRUE  unless you set the focus to a control
}


In the dialog tempate, I created a static frame to use as an anchor (where and how large I wanted the view window to be), and then created a CScrollView object and moved it into position. The tricky bit was getting it not to crash when the dialog box tried to display itself, but calling SetScrollSizes fixed that.

Am I missing something? Should this be hard to do than it appears to be?



------- signature starts

"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

"You won't like me when I'm angry..." - Dr. Bruce Banner

Please review the Legal Disclaimer in my bio.

------- signature ends
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 9:17
BaldwinMartin13-Dec-03 9:17 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 9:32
professional#realJSOP13-Dec-03 9:32 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 9:36
BaldwinMartin13-Dec-03 9:36 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 9:57
professional#realJSOP13-Dec-03 9:57 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 10:10
BaldwinMartin13-Dec-03 10:10 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 10:22
BaldwinMartin13-Dec-03 10:22 
GeneralRe: Putting a view in a dialog box Pin
#realJSOP13-Dec-03 10:44
professional#realJSOP13-Dec-03 10:44 
GeneralRe: Putting a view in a dialog box Pin
Michael Dunn13-Dec-03 11:06
sitebuilderMichael Dunn13-Dec-03 11:06 
GeneralRe: Putting a view in a dialog box Pin
BaldwinMartin13-Dec-03 14:42
BaldwinMartin13-Dec-03 14:42 
GeneralRe: Putting a view in a dialog box Pin
v_srinu_26_f14-Dec-03 8:55
v_srinu_26_f14-Dec-03 8:55 
QuestionHow to Create Tiff Image from CDC.... Pin
Sumit Kapoor13-Dec-03 5:21
Sumit Kapoor13-Dec-03 5:21 
AnswerRe: How to Create Tiff Image from CDC.... Pin
l a u r e n13-Dec-03 8:00
l a u r e n13-Dec-03 8:00 
GeneralRe: How to Create Tiff Image from CDC.... Pin
Sumit Kapoor13-Dec-03 18:20
Sumit Kapoor13-Dec-03 18:20 
Generalproblems with getting RGB values Pin
Cyberizen13-Dec-03 5:16
Cyberizen13-Dec-03 5:16 
GeneralRe: problems with getting RGB values Pin
l a u r e n13-Dec-03 8:01
l a u r e n13-Dec-03 8:01 
QuestionHow to open the project in VC6.0? Pin
zhaopzhi13-Dec-03 3:43
zhaopzhi13-Dec-03 3:43 
AnswerRe: How to open the project in VC6.0? Pin
ZoogieZork13-Dec-03 4:22
ZoogieZork13-Dec-03 4:22 

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.