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

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


OLE control or DLL server

Scott Daniels -- scottdfl@sprynet.com
Thursday, November 07, 1996

Environment: Win 95, VC++ 4.2b

Hi,

I am writing an application with some plug-in components that I will create
under program control, and to which I need to make heavy use of OLE
automation & events. My first inclination is to implement these components
as OLE controls. However, they are not simple window sub-controls, but
rather have a dialog type interface. In other words, the component's window
has multiple windows controls in it. Can I write these components as OLE
controls or should I create them as OLE DLL servers?

If the answer is OLE control, then how do I create the window using a
dialog template?

If the answer is OLE server, then how do I create it at runtime under
program control? This operation is not something I want to user to do via
"Insert Object".

Thanks in advance for the help,

Scott Daniels             scottdfl@sprynet.com
"Life appears the way you choose to see it."



Kanir Pandya -- kpandya@harbinger.net
Monday, November 11, 1996

OLE Control looks like the right solution for your problem. To create a window
using a dialog template make CFormView as a part of your OLE Control.  

Kanir.

----------
From: 	Scott Daniels[SMTP:scottdfl@sprynet.com]
Sent: 	Thursday, November 07, 1996 10:30 PM
To: 	MFC Mailing List
Subject: 	OLE control or DLL server

Environment: Win 95, VC++ 4.2b

Hi,

I am writing an application with some plug-in components that I will create
under program control, and to which I need to make heavy use of OLE
automation & events. My first inclination is to implement these components
as OLE controls. However, they are not simple window sub-controls, but
rather have a dialog type interface. In other words, the component's window
has multiple windows controls in it. Can I write these components as OLE
controls or should I create them as OLE DLL servers?

If the answer is OLE control, then how do I create the window using a
dialog template?

If the answer is OLE server, then how do I create it at runtime under
program control? This operation is not something I want to user to do via
"Insert Object".

Thanks in advance for the help,

Scott Daniels             scottdfl@sprynet.com
"Life appears the way you choose to see it."





Gareth Jones -- gaj@i2.co.uk
Wednesday, November 13, 1996

>> From: 	Scott Daniels[SMTP:scottdfl@sprynet.com]
>> Sent: 	Thursday, November 07, 1996 10:30 PM
>> To: 	MFC Mailing List
>> Subject: 	OLE control or DLL server
>>
>> Environment: Win 95, VC++ 4.2b
>>
>> Hi,
>>
>> I am writing an application with some plug-in components that I will 
create
>> under program control, and to which I need to make heavy use of OLE
>> automation & events. My first inclination is to implement these 
components
>> as OLE controls. However, they are not simple window sub-controls, but
>> rather have a dialog type interface. In other words, the component's 
window
>> has multiple windows controls in it. Can I write these components as OLE
>> controls or should I create them as OLE DLL servers?
>>
>> If the answer is OLE control, then how do I create the window using a
>> dialog template?
>>
>> If the answer is OLE server, then how do I create it at runtime under
>> program control? This operation is not something I want to user to do 
via
>> "Insert Object".
>>
>> Thanks in advance for the help,
>>
>> Scott Daniels             scottdfl@sprynet.com
>> "Life appears the way you choose to see it."
>>

I hate to sully the list with references to Visual Basic, but it sounds to 
me like the ideal tool for this job
would be Visual Basic 5.0 Control Creation Edition which makes it extremely 
easy to create form-based
ActiveX Controls in just a few minutes.  The downloadable Beta is pretty 
stable and MS has said that even the final release version of the tool will 
be free.  Unless you have a great deal of logic behind the forms that will 
actually be in
the control then the pain of writing a form based control in VC++ is 
probably not worth it.

If you really want to, then if you look on the Web under Microsoft's 
Support area you'll find a sample for creating a
form-based OLE control with a reasonable base class for the job.

Gareth




Joe willmann -- joew@mdhost.cse.tek.com
Friday, November 15, 1996

> I am writing an application with some plug-in components that I will create
> under program control, and to which I need to make heavy use of OLE
> automation & events. My first inclination is to implement these components
> as OLE controls. However, they are not simple window sub-controls, but
> rather have a dialog type interface. In other words, the component's window
> has multiple windows controls in it. Can I write these components as OLE
> controls or should I create them as OLE DLL servers?
>
> If the answer is OLE control, then how do I create the window using a
> dialog template?

This is something I got from Mike_Massa@msn.com

1. Create a dialog template with WS_CHILD ans WS_EX_CONTROLPARENT and with
neither a WS_BORDER or WS_CAPTION setting

2. Create a class using Class Wizard

3. Make that CMyDialog class a variable in your CMyCtrl class

4. in the CMyCtrl::OnCreate() call m_myDialog.Create(IDD_DIALOD,this)
By the way if your dialog templates have OCXes in it you will need to refer
to KB Q150029 and put AfxEnableControlContainer in your InitInstance

This assumes you are storing the dialog resource in the OCX dll rather than
the exe.

This has been an excerpt from a post made by Mr Massa.  I used it and it
supplies the basics and works.  There are a lot of other things that you
will have to do like tab ordering and sizing issues but this should get you
started.

Joe Willmann
My opinions are my own, not Tektronix, or anyone elses for that matter!





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