15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Problem inserting ocx into customized dialog template..

Syed -- sxs296@psu.edu
Sunday, December 01, 1996

Environment: Visual C++ 4.0, Win95

I have an ocx which I have been trying to insert to a dialog template of a
customize file open dialog (common dialog). The problem is the customized
open dialog simply refused to come out and whenever I remove that ocx from
the dialog template, the problem just dissappear. I however, have no problem
at all with other dialogs. I suspect that this is due to the fact that file
open dialog is fired from win95's kernel library and therefore, uninformed
of the ocx existance. Is my assumption correct..?? I don't really know. Can
someone please tell me what's wrong with this.?
I followed this method to develop my customized open dialog.
First, I create a dialog template and then along with the requirement for
the file-open template (like a static with id stc32), I put an OCX and
several other controls. Then, using class wizard, I create an appropriate
class derived from CFileDialog and override the DoModal member function as
follow:-
int CFileOpenExDlg::DoModal()
{
SetTemplate(NULL, MAKEINTRESOURCE(IDD));
return CFileDialog::DoModal();
}
Now, again the dialog will never get displayed unless I remove that OCX
which is obviously, not I want.
Thanks for all answers. Really appreciate them.





Alexander Gavrilov -- Alexander_Gavrilov@esicorp.com
Tuesday, December 03, 1996

I think the problem might be that you need AfxEnableControlContainer() in 
InitInstance() of your application. This line is automatically generated by 
AppWizard if you choose OLE Controls support.



>Environment: Visual C++ 4.0, Win95
     
>I have an ocx which I have been trying to insert to a dialog template of a 
>customize file open dialog (common dialog). The problem is the customized 
>open dialog simply refused to come out and whenever I remove that ocx from 
>the dialog template, the problem just dissappear. I however, have no 
>problem at all with other dialogs. I suspect that this is due to the fact 
>that file open dialog is fired from win95's kernel library and therefore, 
>uninformed of the ocx existance. Is my assumption correct..?? I don't 
>really know. Can someone please tell me what's wrong with this.?
>I followed this method to develop my customized open dialog.
>First, I create a dialog template and then along with the requirement for 
>the file-open template (like a static with id stc32), I put an OCX and 
>several other controls. Then, using class wizard, I create an appropriate 
>class derived from CFileDialog and override the DoModal member function as 
>follow:-
>int CFileOpenExDlg::DoModal()
>{
>SetTemplate(NULL, MAKEINTRESOURCE(IDD)); 
>return CFileDialog::DoModal();
>}
>Now, again the dialog will never get displayed unless I remove that OCX 
>which is obviously, not I want.
>Thanks for all answers. Really appreciate them.
     
Alexander Gavrilov
alexander_gavrilov@esicorp.com
     
     



Syed -- sxs296@psu.edu
Friday, December 06, 1996

[Mini-digest: 2 responses]

At 02:56 PM 12/3/96 -0600, you wrote:
>I think the problem might be that you need AfxEnableControlContainer() in 
>InitInstance() of your application. This line is automatically generated by 
>AppWizard if you choose OLE Controls support.
>
>
>
>>Environment: Visual C++ 4.0, Win95
>     
>>I have an ocx which I have been trying to insert to a dialog template of a 
>>customize file open dialog (common dialog). The problem is the customized 
>>open dialog simply refused to come out and whenever I remove that ocx from 
>>the dialog template, the problem just dissappear. I however, have no 
>>problem at all with other dialogs. I suspect that this is due to the fact 
>>that file open dialog is fired from win95's kernel library and therefore, 
>>uninformed of the ocx existance. Is my assumption correct..?? I don't 
>>really know. Can someone please tell me what's wrong with this.?
>>I followed this method to develop my customized open dialog.
>>First, I create a dialog template and then along with the requirement for 
>>the file-open template (like a static with id stc32), I put an OCX and 
>>several other controls. Then, using class wizard, I create an appropriate 
>>class derived from CFileDialog and override the DoModal member function as 
>>follow:-
>>int CFileOpenExDlg::DoModal()
>>{
>>SetTemplate(NULL, MAKEINTRESOURCE(IDD)); 
>>return CFileDialog::DoModal();
>>}
>>Now, again the dialog will never get displayed unless I remove that OCX 
>>which is obviously, not I want.
>>Thanks for all answers. Really appreciate them.
>     
Nope.. it's already there in my InitInstance. As I said earlier, I have no
problem with other dialog; it performs flawlessly..

-----From: Logan Gilbert 

	You can also add control containment support to you app by simply =
chossing Insert->Component on the menu bar of VC++ 4.x to bring up the =
Component Gallery.  Select the Microsoft Tab and choose OLE Control =
Containment to add Containment ability to your app.  This way you don't =
have to create an new app using the AppWizard.  It adds =
AfxEnableControlContainer() to you InitInstance() of your application, =
AND it adds #include  to your stdafx.h file.  Obviously you =
could do this manually.  It does sound like this could be the problem.

	If you so choose to create a new app which you know will use controls =
you can select OLE controls support in the AppWizard as stated in the =
previous answer. =20

Logan
----------
From: 	Alexander Gavrilov
Sent: 	Tuesday, December 03, 1996 2:56 PM
To: 	mfc-l@netcom.com
Subject: 	Re: Problem inserting ocx into customized dialog template..

I think the problem might be that you need AfxEnableControlContainer() =
in=20
InitInstance() of your application. This line is automatically generated =
by=20
AppWizard if you choose OLE Controls support.



>Environment: Visual C++ 4.0, Win95
    =20
>I have an ocx which I have been trying to insert to a dialog template =
of a=20
>customize file open dialog (common dialog). The problem is the =
customized=20
>open dialog simply refused to come out and whenever I remove that ocx =
from=20
>the dialog template, the problem just dissappear. I however, have no=20
>problem at all with other dialogs. I suspect that this is due to the =
fact=20
>that file open dialog is fired from win95's kernel library and =
therefore,=20
>uninformed of the ocx existance. Is my assumption correct..?? I don't=20
>really know. Can someone please tell me what's wrong with this.?
>I followed this method to develop my customized open dialog.
>First, I create a dialog template and then along with the requirement =
for=20
>the file-open template (like a static with id stc32), I put an OCX and=20
>several other controls. Then, using class wizard, I create an =
appropriate=20
>class derived from CFileDialog and override the DoModal member function =
as=20
>follow:-
>int CFileOpenExDlg::DoModal()
>{
>SetTemplate(NULL, MAKEINTRESOURCE(IDD));=20
>return CFileDialog::DoModal();
>}
>Now, again the dialog will never get displayed unless I remove that OCX =

>which is obviously, not I want.
>Thanks for all answers. Really appreciate them.
    =20
Alexander Gavrilov
alexander_gavrilov@esicorp.com
    =20
    =20




| Вернуться в корень Архива |