Click here to Skip to main content
16,006,001 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralTime function Pin
Supaflyfrank26-Aug-04 5:53
Supaflyfrank26-Aug-04 5:53 
GeneralRe: Time function Pin
jmkhael26-Aug-04 6:18
jmkhael26-Aug-04 6:18 
GeneralRe: Time function Pin
David Crow26-Aug-04 8:52
David Crow26-Aug-04 8:52 
GeneralRe: Time function Pin
Bob Stanneveld26-Aug-04 10:24
Bob Stanneveld26-Aug-04 10:24 
GeneralRe: Time function Pin
David Crow26-Aug-04 10:26
David Crow26-Aug-04 10:26 
GeneralRe: Time function Pin
Supaflyfrank26-Aug-04 13:00
Supaflyfrank26-Aug-04 13:00 
QuestionGetMoniker ? Pin
Scozturk26-Aug-04 5:47
professionalScozturk26-Aug-04 5:47 
GeneralCreating a [modeless] dialog-box with no resource image file Pin
0v3rloader26-Aug-04 5:33
0v3rloader26-Aug-04 5:33 
Hello there,

I am trying to create a modeless dialog-box dynamically, without using a resource image file. The following code illustrates my (useless) effort so far:

BOOL CDlg::Setup()
{
	DLGTEMPLATE DlgTemplate;
	WORD MenuNull = NULL;		// no menu!
	WORD ClassNull = NULL;		// no class defined => use default
	WORD TitleNull = NULL;		// we'll define the title later on
	//							   by calling the appropriate method
	int nScrHeight;
	int nScrWidth;
	RECT rect;
	// > END_VAR_DECL
	// -------------------
	// get the screen height/width
	nScrWidth = ::GetSystemMetrics(SM_CXSCREEN);
	nScrHeight = ::GetSystemMetrics(SM_CYSCREEN);
	// create the template
	DlgTemplate.cx = nScrWidth / 5;				// width = 1/5(nScrWidth)
	DlgTemplate.cy = nScrHeight >> 2;			// height = 1/4(nScrHeight)
	DlgTemplate.x = nScrWidth - DlgTemplate.cx;	// init at the top-right corner of the screen
	DlgTemplate.y = 0;							//
	DlgTemplate.cdit = 0;						// 0 controls (for now...)
	DlgTemplate.style = WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_3DLOOK;
	DlgTemplate.dwExtendedStyle = 0;

	if(!CreateIndirect(&DlgTemplate))
		return FALSE;			// failed to create the dialog box
	.
	:
	.


After calling CDialog::CreateIndirect, there is an error that occurs at WinAPI level -- Error 1813 -- The specified resource type cannot be found in the image file.

If you could please tell me what I am doing wrong here, I would greatly appreciate it!

Thank you so much,

David Nimrod
GeneralRe: Creating a [modeless] dialog-box with no resource image file Pin
Joaquín M López Muñoz26-Aug-04 10:30
Joaquín M López Muñoz26-Aug-04 10:30 
GeneralPointer to Shared Memory Pin
sweep12326-Aug-04 5:32
sweep12326-Aug-04 5:32 
GeneralRe: Pointer to Shared Memory Pin
jmkhael26-Aug-04 5:53
jmkhael26-Aug-04 5:53 
GeneralRe: Pointer to Shared Memory Pin
sweep12326-Aug-04 6:30
sweep12326-Aug-04 6:30 
GeneralRe: Pointer to Shared Memory Pin
jmkhael26-Aug-04 6:33
jmkhael26-Aug-04 6:33 
GeneralRe: Pointer to Shared Memory Pin
Rick York26-Aug-04 6:40
mveRick York26-Aug-04 6:40 
Generaldisplaying tiff and jpg image on dialog application Pin
pnpfriend26-Aug-04 5:14
pnpfriend26-Aug-04 5:14 
GeneralRe: displaying tiff and jpg image on dialog application Pin
David Salter26-Aug-04 5:21
David Salter26-Aug-04 5:21 
GeneralCListView popup filter Pin
muamw1026-Aug-04 5:01
muamw1026-Aug-04 5:01 
GeneralRe: CListView popup filter Pin
BlackDice26-Aug-04 5:26
BlackDice26-Aug-04 5:26 
GeneralRe: CListView popup filter Pin
muamw1026-Aug-04 9:09
muamw1026-Aug-04 9:09 
GeneralRe: CListView popup filter Pin
mao7819-Jan-09 5:05
mao7819-Jan-09 5:05 
GeneralDrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 5:00
Jörgen Sigvardsson26-Aug-04 5:00 
GeneralRe: DrawThemeIcon Pin
JBoschen26-Aug-04 8:06
JBoschen26-Aug-04 8:06 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 9:25
Jörgen Sigvardsson26-Aug-04 9:25 
GeneralRe: DrawThemeIcon Pin
JBoschen26-Aug-04 9:28
JBoschen26-Aug-04 9:28 
GeneralRe: DrawThemeIcon Pin
Jörgen Sigvardsson26-Aug-04 9:32
Jörgen Sigvardsson26-Aug-04 9:32 

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.