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

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


Question about OCX's and toolbars, menubars, statusbars

David Dworkin -- ddworkin@wpine.com
Tuesday, July 30, 1996

Environment: VC++ 4.2, Win95

Hi folks,

I have a question about writing OCX's.  I'm trying to convert
an MFC application into an OCX, and the first thing I'm trying to do
is get a toolbar and statusbar to appear in the control.  I ran 4.2's
control wizard to get a vanilla control.  In the MFC app, the toolbar
and status bar are created in the OnCreate.  What trick do I need to do
to get them to appear in the control?

Are there any guidelines (function mappings, or something) comparing
MFC app's to OCX's?

Does anyone have any sample source, or pointers to sample source, which
do what I'm trying to do?

Thanks very much,

David Dworkin
ddworkin@wpine.com
============================================================================
David Dworkin                           ddworkin@wpine.com

White Pine Software                     White Pine Software
15 Messenger St.                        40 Simon St.
Plainville MA 02762                     Nashua NH 03060
508-699-7051 / 508-695-2378 (Fax)       603-886-9050 / 603-886-9051 (Fax)
www.wpine.com (WWW)                     www.wpine.com (WWW)
============================================================================




Michael S. Scherotter -- mss@tartus.com
Monday, August 05, 1996

> I have a question about writing OCX's.  I'm trying to convert
> an MFC application into an OCX, and the first thing I'm trying to do
> is get a toolbar and statusbar to appear in the control.  I ran 4.2's
> control wizard to get a vanilla control.  In the MFC app, the toolbar
> and status bar are created in the OnCreate.  What trick do I need to do
> to get them to appear in the control?
> 

David,
I think you are a little confused about the function of an OCX.  An OCX is not a 
runnable program, it is a control that you put on a dialog box.  Read in the 
Visual C++ manual about the usage of a OLE custom Control.

Michael

-- 
Michael S. Scherotter            |Architectural Design Tools
Lead Software Developer          |AutoCAD Applications
Tartus Development, Inc.         |Custom CAD Solutions
630 Las Gallinas Ave #300        |__________________________ 
San Rafael, CA 94903                          mss@tartus.com
(415) 491-8925                          michael@charette.com
(415) 491-8921 (fax)               71035.1675@compuserve.com
               http://www.tartus.com/people/mss
____________________________________________________________



David Dworkin -- ddworkin@wpine.com
Tuesday, August 13, 1996

Hi Michael,

I'm familiar with what an OCX is.  Just because an OCX can be as simple 
as a button or another windows control, that doesn't imply that they
are all that simple.

I guess more specifically, I'm trying to write an ActiveX control, which 
encapsulates the functionality of an MFC application, and which would be 
contained within a web page.

Any tips, tricks, advice, black magic, etc from anyone would be appreciated.

David


At 09:00 AM 8/5/96 -0700, Michael Scherotter wrote:
>> I have a question about writing OCX's.  I'm trying to convert
>> an MFC application into an OCX, and the first thing I'm trying to do
>> is get a toolbar and statusbar to appear in the control.  I ran 4.2's
>> control wizard to get a vanilla control.  In the MFC app, the toolbar
>> and status bar are created in the OnCreate.  What trick do I need to do
>> to get them to appear in the control?
>> 
>
>David,
>I think you are a little confused about the function of an OCX.  An OCX is
not a 
>runnable program, it is a control that you put on a dialog box.  Read in the 
>Visual C++ manual about the usage of a OLE custom Control.
>
>Michael
>
>-- 
>Michael S. Scherotter            |Architectural Design Tools
>Lead Software Developer          |AutoCAD Applications
>Tartus Development, Inc.         |Custom CAD Solutions
>630 Las Gallinas Ave #300        |__________________________ 
>San Rafael, CA 94903                          mss@tartus.com
>(415) 491-8925                          michael@charette.com
>(415) 491-8921 (fax)               71035.1675@compuserve.com
>               http://www.tartus.com/people/mss
>____________________________________________________________
>
============================================================================
David Dworkin                           ddworkin@wpine.com

White Pine Software                     White Pine Software
15 Messenger St.                        40 Simon St.
Plainville MA 02762                     Nashua NH 03060
508-699-7051 / 508-695-2378 (Fax)       603-886-9050 / 603-886-9051 (Fax)
www.wpine.com (WWW)                     www.wpine.com (WWW)
============================================================================




Mike Blaszczak -- mikeblas@nwlink.com
Thursday, August 15, 1996

[Mini-digest: 4 responses]

At 01:20 PM 8/13/96 -0400, David Dworkin wrote:

>I'm familiar with what an OCX is.  Just because an OCX can be as simple 
>as a button or another windows control, that doesn't imply that they
>are all that simple.

No: some controls can be impressively robust.  But a control is a
_CONTROL_.  It is not a form or a dialog box or an application.

>I guess more specifically, I'm trying to write an ActiveX control, which 
>encapsulates the functionality of an MFC application, and which would be 
>contained within a web page.

I think you might want to consider having a collection of ActiveX controls
rather than just one single control.  It really depends on your user interface,
though--there are some applications that could be made into a single control,
while others (most, probably) just can't be conveniently held in a single
control.

.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.

-----From: mss@tartus.com (Michael Scherotter)

David,
My company is using complex OCXs as a major part of our development
strategy.  
We are using the OCX controls to encapsulate the whole User interface
aspect of our application (Using context menus instead of top-of-window menus).
In this way we are able to do almost everything.
If the control is OLE insertable, it can even behave as a standard OLE object.

What specific MFC application functionality are you looking for?

Michael

Michael S. Scherotter            |Architectural Design Tools
Lead Software Developer          |AutoCAD Applications
Tartus Development, Inc.         |Custom CAD Solutions
630 Las Gallinas Ave #300        |__________________________ 
San Rafael, CA 94903                          mss@tartus.com
(415) 491-8925                          michael@charette.com
(415) 491-8921 (fax)               71035.1675@compuserve.com
               http://www.tartus.com/people/mss
____________________________________________________________
-----From: "Mike Massa" 

Hi David,

I am probably not going to answer your exact question, but I am going to try 
to give you an alternative.

First, ActiveX controls can be "contained within a web page" as you ask, 
withOUT any special modifications!  To me this is really the exciting part of 
what OLE is all about, the fact that new technology can always use the same 
old technology.

Now as far as your original question about converting an MFC app to an OCX 
control so you can contain it within a web page, it appears to me that you 
might want to take a look at ActiveX Documents (DocObjects).   DocObjects, are 
the "Server" side of an MS Office Binder, and IE30 incorporates much the same 
function.  Basically, you can view all those control bars etc that you want 
within IE3O.  It's cool stuff.

I think the online docs in www.microsoft.com can better explain what they are 
all about.

C ya,
Mike Massa

-----From: "Erik Funkenbusch" 

You are really on a futile course.  The reason is that MFC applications are
designed to be document/view.  OCX's are are view only, thus all the cool
functionality of menu bars, etc are not supported.  Menu's are supposed to
be merged with the containers menus, the control itself is not (and cannot,
becuase it is not a top level window) supposed to have it's own menus.

What you might investigate, however, is ActiveX Documents Objects.  These
are variations on the In-Place active theme designed to work with MS Office
Binder and Internet Explorer 3 (or any Doc object container).

There is an example in VC 4.1 and 4.2 called bindscrib, 4.1 hacked doc
object support in, 4.2 has it native in MFC.






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