Click here to Skip to main content
15,914,608 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: supressing a unused variable warning Pin
Gary R. Wheeler3-Dec-04 14:25
Gary R. Wheeler3-Dec-04 14:25 
Generalproblem resoting DB using VC++!! Pin
venadder3-Dec-04 8:08
venadder3-Dec-04 8:08 
GeneralRe: problem resoting DB using VC++!! Pin
David Crow3-Dec-04 9:09
David Crow3-Dec-04 9:09 
GeneralRe: problem resoting DB using VC++!! Pin
venadder3-Dec-04 11:43
venadder3-Dec-04 11:43 
GeneralRe: problem resoting DB using VC++!! Pin
David Crow3-Dec-04 12:11
David Crow3-Dec-04 12:11 
GeneralRe: problem resoting DB using VC++!! Pin
venadder3-Dec-04 12:15
venadder3-Dec-04 12:15 
GeneralRe: problem resoting DB using VC++!! Pin
David Crow6-Dec-04 2:20
David Crow6-Dec-04 2:20 
Generaladding bitmap to a cbutton Pin
prateekkathuria3-Dec-04 5:47
prateekkathuria3-Dec-04 5:47 
GeneralRe: adding bitmap to a cbutton Pin
David Crow3-Dec-04 6:01
David Crow3-Dec-04 6:01 
GeneralRe: adding bitmap to a cbutton Pin
prateekkathuria3-Dec-04 6:08
prateekkathuria3-Dec-04 6:08 
GeneralRe: adding bitmap to a cbutton Pin
Ravi Bhavnani3-Dec-04 6:24
professionalRavi Bhavnani3-Dec-04 6:24 
GeneralRe: adding bitmap to a cbutton Pin
prateekkathuria3-Dec-04 8:53
prateekkathuria3-Dec-04 8:53 
GeneralRe: adding bitmap to a cbutton Pin
prateekkathuria3-Dec-04 9:25
prateekkathuria3-Dec-04 9:25 
Questionmigrating MFC 6.0 app to 7.0; gotchas ? Pin
dvolpe3-Dec-04 5:07
dvolpe3-Dec-04 5:07 
AnswerRe: migrating MFC 6.0 app to 7.0; gotchas ? Pin
Chris Meech3-Dec-04 6:49
Chris Meech3-Dec-04 6:49 
AnswerRe: migrating MFC 6.0 app to 7.0; gotchas ? Pin
john john mackey3-Dec-04 8:44
john john mackey3-Dec-04 8:44 
AnswerRe: migrating MFC 6.0 app to 7.0; gotchas ? Pin
Kevin McFarlane4-Dec-04 4:18
Kevin McFarlane4-Dec-04 4:18 
GeneralMS VC++ & Flash Pin
Serg314163-Dec-04 4:07
Serg314163-Dec-04 4:07 
Generalmaybe a stupid Question,but need help! Pin
josephvan3-Dec-04 3:22
josephvan3-Dec-04 3:22 
GeneralRe: maybe a stupid Question,but need help! Pin
Mike Danberg3-Dec-04 9:32
Mike Danberg3-Dec-04 9:32 
GeneralRe: maybe a stupid Question,but need help! Pin
Mike O'Neill3-Dec-04 14:06
Mike O'Neill3-Dec-04 14:06 
You can add a CEdit to a CView-derived class (call it CMyView) easily.

In the MyView.h file, add a CEdit member varaible (call it m_ctlEdit).

In the MyView.cpp file, add message handlers for WM_CREATE (i.e., OnCreate) and WM_SIZE (i.e., OnSize). Add code like this:

int CMyView::OnCreate(LPCREATESTRUCT lpCreateStruct) <br />
{<br />
	if (CView::OnCreate(lpCreateStruct) == -1)<br />
		return -1;<br />
	<br />
	DWORD dwStyle =  WS_CHILD | WS_VISIBLE; // and any other styles you want<br />
<br />
	if ( !m_ctlEdit.Create( dwStyle, CRect(1,2,3,4), this, 0x1245 /* arbitrary ctl ID */ ) )<br />
	{<br />
		return -1;<br />
	}<br />
<br />
	return 0;<br />
}<br />
<br />
<br />
void CMyView::OnSize(UINT nType, int cx, int cy) <br />
{<br />
	CView::OnSize(nType, cx, cy);<br />
	<br />
	CRect rc;<br />
	<br />
	GetClientRect( &rc );<br />
<br />
	m_ctlEdit.SetWindowPos( this, 0, 0, rc.Width(), rc.Height(), SWP_NOZORDER );<br />
}


This will fill the view with the edit, which might not be what you want, but it's easy to adjust.

Mike
GeneralReadFile(), what is wrong?!! Pin
tswan3-Dec-04 3:17
tswan3-Dec-04 3:17 
GeneralRe: ReadFile(), what is wrong?!! Pin
Blake Miller3-Dec-04 4:04
Blake Miller3-Dec-04 4:04 
GeneralRe: ReadFile(), what is wrong?!! Pin
tswan5-Dec-04 2:48
tswan5-Dec-04 2:48 
GeneralOn-Screen Keyboard Pin
Tripura.K3-Dec-04 2:36
Tripura.K3-Dec-04 2:36 

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.