Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Failed to Create Empty Document Pin
dotbomb11-Mar-04 5:13
dotbomb11-Mar-04 5:13 
GeneralRe: Failed to Create Empty Document Pin
Iain Clarke, Warrior Programmer11-Mar-04 5:33
Iain Clarke, Warrior Programmer11-Mar-04 5:33 
QuestionHow to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 3:46
vgrigor9-Mar-04 3:46 
AnswerRe: How to change font of Cdialog programmatically ? Pin
David Crow9-Mar-04 4:01
David Crow9-Mar-04 4:01 
GeneralRe: How to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 4:06
vgrigor9-Mar-04 4:06 
GeneralRe: How to change font of Cdialog programmatically ? Pin
David Crow9-Mar-04 4:21
David Crow9-Mar-04 4:21 
GeneralRe: How to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 4:29
vgrigor9-Mar-04 4:29 
GeneralRe: How to change font of Cdialog programmatically ? Pin
vgrigor9-Mar-04 5:57
vgrigor9-Mar-04 5:57 
Code from above article do not work for ActiveX,

do you know how to correct it for that purpose?

<br />
	int Create_WithHelper(int IDD, CWnd* pParentWnd,  int isModal, int size, CString FontName = "MS Sans Serif")<br />
	{<br />
		//dlg_T pDialog = arg_pDialog;<br />
<br />
			CDialogTemplate dlt;<br />
			int     nResult;<br />
<br />
		// load dialog template<br />
		if (!dlt.Load(MAKEINTRESOURCE(IDD))) return -1;<br />
<br />
		// set your own font, for example "Arial", 10 pts. <br />
<br />
			dlt.SetFont("Arial", 14);	<br />
		// get pointer to the modified dialog template<br />
		LPSTR pdata = (LPSTR)GlobalLock(dlt.m_hTemplate);<br />
			<br />
		// let MFC know that you are using your own template<br />
		   <br />
		//dlg_T::<br />
			//pDialog-><br />
				m_lpszTemplateName = NULL;<br />
<br />
		HINSTANCE hInst = AfxFindResourceHandle(MAKEINTRESOURCE(IDD), RT_DIALOG);<br />
			<br />
			BOOL bResult ;<br />
<br />
			//pDialog-><br />
				m_hDialogTemplate = dlt.m_hTemplate;<br />
<br />
			<br />
			<br />
			if(isModal)	<br />
			{<br />
				nResult = <br />
					//pDialog-><br />
					DoModal();<br />
			}<br />
			else<br />
			{<br />
				bResult = <br />
					//pDialog-><br />
					CreateIndirect(  dlt.m_hTemplate, pParentWnd);<br />
			}<br />
			<br />
<br />
<br />
			GlobalUnlock(dlt.m_hTemplate);<br />
<br />
			if(m_hWnd == 0 )<br />
				ASSERT(0);//for test<br />
<br />
			//bResult = CreateIndirect(hTemplate, pParentWnd, hInst);<br />
			//FreeResource(hTemplate);<br />
<br />
			return bResult;	<br />
	<br />
	};<br />

GeneralRe: How to change font of Cdialog programmatically ? Pin
win32newb11-Mar-04 21:22
susswin32newb11-Mar-04 21:22 
GeneralRe: How to change font of Cdialog programmatically ? Pin
David Crow12-Mar-04 3:46
David Crow12-Mar-04 3:46 
GeneralRe: Failed to Create Empty Document Pin
David Crow9-Mar-04 4:03
David Crow9-Mar-04 4:03 
GeneralCreateNamedPipe Pin
hph9-Mar-04 3:32
hph9-Mar-04 3:32 
GeneralRe: CreateNamedPipe Pin
David Crow9-Mar-04 3:37
David Crow9-Mar-04 3:37 
GeneralRe: CreateNamedPipe Pin
hph9-Mar-04 3:44
hph9-Mar-04 3:44 
GeneralRe: CreateNamedPipe Pin
David Crow9-Mar-04 4:07
David Crow9-Mar-04 4:07 
GeneralRe: CreateNamedPipe Pin
hph9-Mar-04 4:24
hph9-Mar-04 4:24 
GeneralDebug System Wide Hooks Pin
bilal789-Mar-04 1:53
bilal789-Mar-04 1:53 
GeneralOut of virtual memory Pin
martin_j9-Mar-04 1:44
martin_j9-Mar-04 1:44 
GeneralRe: Out of virtual memory Pin
David Crow9-Mar-04 2:18
David Crow9-Mar-04 2:18 
GeneralRe: Out of virtual memory Pin
Prakash Nadar9-Mar-04 2:38
Prakash Nadar9-Mar-04 2:38 
GeneralRe: Out of virtual memory Pin
martin_j9-Mar-04 2:59
martin_j9-Mar-04 2:59 
GeneralRe: Out of virtual memory Pin
wb9-Mar-04 3:31
wb9-Mar-04 3:31 
GeneralRe: Out of virtual memory Pin
David Crow9-Mar-04 3:33
David Crow9-Mar-04 3:33 
GeneralRe: Out of virtual memory Pin
martin_j9-Mar-04 3:41
martin_j9-Mar-04 3:41 
GeneralRe: Out of virtual memory Pin
wb9-Mar-04 3:46
wb9-Mar-04 3:46 

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.