[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Using the CDialog::InitModalIndirect() function.

Posted on 1999-01-17
1
Medium Priority
?
2,361 Views
Last Modified: 2013-11-20
I need a code example for using the:
CDialog::InitModalIndirect().

I am trying to use the next code but no dialog apears and the DoModal() function return immediatly.

DLGTEMPLATE lpDialogTemplate;
lpDialogTemplate.style=DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE;
lpDialogTemplate.dwExtendedStyle=0;
lpDialogTemplate.cdit=0;
lpDialogTemplate.x=0;
lpDialogTemplate.y=0;
lpDialogTemplate.cx=100;
lpDialogTemplate.cy=100;


CDialog Dialog;
int Result = Dialog.InitModalIndirect(&lpDialogTemplate,this);
Result = Dialog.DoModal();
0
Comment
Question by:zona
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
plaroche earned 60 total points
ID: 1327853
If you read the doc for DOCTEMPLATE you will see that you need to allocate other items directly following the structure in memory. Namely menu array, class array and title array. there is also variable amount of DLGITEMTEMPLATE items to be allocated following this in memory.

Memory view:

0x0000 DIALOGTEMPLATE
0x.... MENU array
0x.... Window Class array
0x.... Title array
0x.... one or more DLGITEMTEMPLATE structs...

I suggest you take a look at the DLGTEMPL sample, it is quite a complicated task to do dynamic dialog creation like this.

0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question