Click here to Skip to main content
15,910,277 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using a dialog as a control Pin
moredip1-Aug-02 11:10
moredip1-Aug-02 11:10 
GeneralRe: Using a dialog as a control Pin
Chris Losinger1-Aug-02 11:37
professionalChris Losinger1-Aug-02 11:37 
GeneralRe: Using a dialog as a control Pin
moredip1-Aug-02 11:43
moredip1-Aug-02 11:43 
GeneralRe: Using a dialog as a control Pin
Chris Losinger1-Aug-02 11:46
professionalChris Losinger1-Aug-02 11:46 
GeneralRe: Using a dialog as a control Pin
moredip1-Aug-02 11:51
moredip1-Aug-02 11:51 
GeneralRe: Using a dialog as a control Pin
Chris Losinger1-Aug-02 11:52
professionalChris Losinger1-Aug-02 11:52 
GeneralRe: Using a dialog as a control Pin
moredip1-Aug-02 11:57
moredip1-Aug-02 11:57 
GeneralRe: Using a dialog as a control Pin
moredip1-Aug-02 12:20
moredip1-Aug-02 12:20 
So, for those who are interested, here is how I did it (finally):

ModifyStyle() can't be used, possibly because of the way dialogs are loaded from resources.

But it is possible to programmatically modify the resource, as follows:

	CString strIDD;
	strIDD.Format( "#%u", IDD_VCR ); //where IDD_VCR is the dialog resource I wish to embed
	DLGTEMPLATEEX* pDlgTemplate = (DLGTEMPLATEEX*)::LockResource( ::LoadResource( NULL, ::FindResource( NULL, strIDD, RT_DIALOG ) ) );

	//set the dialog style so that we can use it as an embedded control (see the #defines for WS_POPUP etc in WINUSER.H)
	pDlgTemplate->Style = 0x40000844;
	

	m_pVCR = new DEmbeddedVCR();
	m_pVCR->CreateIndirect( pDlgTemplate, this );

//note that we cannot directly 'unlock' pDlgTemplate, this is handled by Windoze

This should all really be put in DEmbeddedVCR::Create(), rather than called 'client-side' as it were.

Hope that helps out someone at some point...

Pete
Generalerror doing a select distinct Pin
ns1-Aug-02 9:35
ns1-Aug-02 9:35 
GeneralRe: error doing a select distinct Pin
Ravi Bhavnani1-Aug-02 9:44
professionalRavi Bhavnani1-Aug-02 9:44 
GeneralRe: error doing a select distinct Pin
ns1-Aug-02 9:51
ns1-Aug-02 9:51 
GeneralRe: error doing a select distinct Pin
Ravi Bhavnani1-Aug-02 9:57
professionalRavi Bhavnani1-Aug-02 9:57 
GeneralRe: error doing a select distinct Pin
achandra0071-Aug-02 9:58
achandra0071-Aug-02 9:58 
GeneralRe: error doing a select distinct Pin
Joaquín M López Muñoz1-Aug-02 9:59
Joaquín M López Muñoz1-Aug-02 9:59 
GeneralIts resolved, thanks! Pin
ns1-Aug-02 10:12
ns1-Aug-02 10:12 
GeneralVC++ 7.0's Attributes Pin
thefirst_bigd1-Aug-02 9:29
thefirst_bigd1-Aug-02 9:29 
GeneralRe: VC++ 7.0's Attributes Pin
Joaquín M López Muñoz1-Aug-02 9:44
Joaquín M López Muñoz1-Aug-02 9:44 
GeneralRe: VC++ 7.0's Attributes Pin
thefirst_big1-Aug-02 11:10
sussthefirst_big1-Aug-02 11:10 
GeneralResizing ListView Column Headers Pin
RussR1-Aug-02 9:30
RussR1-Aug-02 9:30 
QuestionCreateFile for folder in 9x, it is possible? Pin
includeh101-Aug-02 9:18
includeh101-Aug-02 9:18 
Generala simple database question Pin
ns1-Aug-02 9:08
ns1-Aug-02 9:08 
GeneralRe: a simple database question Pin
achandra0071-Aug-02 9:14
achandra0071-Aug-02 9:14 
GeneralRe: a simple database question Pin
ns1-Aug-02 9:18
ns1-Aug-02 9:18 
GeneralUsing stored procs with CRecordset Pin
achandra0071-Aug-02 8:53
achandra0071-Aug-02 8:53 
GeneralAdding text in another application Pin
Baatezu1-Aug-02 8:33
Baatezu1-Aug-02 8:33 

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.