> I have worked out from FONT.DLG what resource control I want
> to disable (CFontDialog). So I did this:
>
> CFontDialog dlgFont( m_plfCurrentFont );
> CWnd *pControl = NULL;
>
> pControl = dlgFont.GetDlgItem( chx1 );
> --> It crashes here. The control window handle is not valid.
> I presume
> because the dialogue has not yet been displayed.
>
> if( pControl != NULL )
> pControl->EnableWindow( FALSE );
> dlgFont.m_cf.Flags |= CF_NOSCRIPTSEL;
> dlgFont.m_cf.rgbColors = m_crCurrentFontColour;
>
> if( dlgFont.DoModal() )
> {
>
> How do I get around this? I thought of making a
> CMyFontDialog inheriting from CFontDialog and maybe in the
> OnInitDialog override doing my function call stuff there.
> Would that be the only way to resolve this problem, if it
> would resolve it at all?
I followed my suggestion through and included dlgs.h in the MyFontDialog.cpp
file and it works fine. The strikeout control is now disabled and I get no
errors. So I guess I will stick with this strategy.
Andrew
This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.
_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for
subscription changes, and list archive.