Re: Dialog box and Custom control
- From: Giovanni Dicanio <giovanniDOTdicanio@xxxxxxxxxxxxxxxxx>
- Date: Wed, 19 Aug 2009 20:18:49 +0200
Giovanni Dicanio ha scritto:
Ehsan Sadeghi ha scritto:
I created a dialog box, put a custom control on it, filled the properties , added headers( custom control) to the dialog box .h file, created a variable of the control,m_Grid, filled the DoDataExchange with DDX_Control(pDX,IDC_GRIDCONTROL,m_Grid) and
If you read the documentation on CodeProject site, you will find that you should replace DDX_Control with DDX_GridControl (see paragraph "Construction" here: http://www.codeproject.com/KB/miscctrl/gridctrl.aspx )
I just created a test VS2008 MFC SDI project and it seems that, including the aforementioned fix, the dialog-box with the grid control is correctly displayed.
You can download the simple test project here:
http://www.geocities.com/giovanni.dicanio/vc/TestGrid.zip
BTW: Note that I had some compiler errors in Chris Munder's original code (stable version 2.25), because of change in behaviour of scope of 'for' loop index in VS2008 with respect to older compilers (probably VC6).
i.e.
for (int i = 0; ... )
{
...
}
int j = i;
compiles fine in VC6 but fails in VS2008, because the scope of the 'i' variable is inside for loop in VS2008 (as C++ standard states).
The above code can be easily modified like this:
int i; // scope of 'i' outside for loop
for (i = 0; ... )
{
...
}
int j = i;
and it compiles fine in VS2008.
HTH,
Giovanni
.
- Follow-Ups:
- Re: Dialog box and Custom control
- From: bachegool
- Re: Dialog box and Custom control
- References:
- Dialog box and Custom control
- From: Ehsan Sadeghi
- Re: Dialog box and Custom control
- From: Giovanni Dicanio
- Dialog box and Custom control
- Prev by Date: Re: Dialog box and Custom control
- Next by Date: Re: Override OnNcHitTest and return HTNOWHERE not working
- Previous by thread: Re: Dialog box and Custom control
- Next by thread: Re: Dialog box and Custom control
- Index(es):
Relevant Pages
|