THIS TOOL IS NOT SUPPORTED BY MICROSOFT CORPORATION. IT IS PROVIDED "AS IS"
BECAUSE WE BELIEVE IT MAY BE USEFUL TO YOU.
NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
It is necessary to build the FrameWrk samples before building ToDoSvr
or WebImage. Running "nmake" from the <sdkdir>\samples\com\activexcontrol\basectl
directory will build all of the sample code in the correct order. Before
building any of the samples, run setenv.bat to add the Microsoft Platform SDK
include, bin, and lib directories to the front of your environment.
More information on the Internet-aware OLE controls is available in
readme.txt files in the sample directories.
The Framework Sample Code for Authoring non-MFC Controls
====+====================================================
This document presents a short discussion on using the ActiveX Controls
Framework to author new ActiveX controls.
0. Contents
=---------=
1.0 Introduction
1.1 Target Audience
1.2 Structure of the Framework
1.3 Target Environment
2.0 Creating an ActiveX Control
2.1 Building the Control
2.2 Working with the In-Process Server
3.0 Working with Your ActiveX Control
3.1 Structure of a Control
3.2 Painting a Control
3.3 Handling Messages in a Control
3.4 Adding a Property
3.5 Adding a Method
3.6 Adding an Event
3.7 Using Standard ActiveX Types
3.8 Throwing an Exception
4.0 Persistence
4.1 Text Persistence
4.2 Binary Persistence
5.0 Property Pages
5.1 Working with a Property Page
5.2 Navigating through Associated Objects
5.3 Marking Your Page as Dirty
6.0 String Manipulation
6.1 Types of Strings
6.2 Working with Strings
7.0 Localization
7.1 Setting up for Localization
8.0 Miscellaneous
8.1 Recommended Reading
8.2 Host-Specific Notes
8.2.1 Microsoft Access 95
1.0 Introduction
=--------------=
The ActiveX Controls Framework is a sample code base from which one can author new
ActiveX controls for use in existing containers, such as Microsoft Visual Basic,
Microsoft Access, and Microsoft Visual FoxPro, or in future containers of ActiveX Controls.
It differs from the Microsoft Visual C++ CDK in many ways. Most notably, this
framework is intended to be considerably more "bare bones." Only minimal
functionality is provided to the programmer. Little in the way of default handlers
for various windows messages, OLE events, et. al. has been provided. The ability
to add them is there, but the code is not. The code base has also been designed
primarily for performance and reduced code size as much as possible. Whenever a
choice between ease of use and performance arose, the latter was typically chosen.
In addition, the code is designed to take advantage of whatever OC '96 features are
available from the host. The code will use any available features, and fall back
to the 'older' behavior for those cases where they aren't.
The code base is extremely extensible, however, and of course, all the source code
is there -- if something doesn't do what you want it to, make it.
1.1 Target Audience
This framework targets a slightly more advanced programmer than the Microsoft
Visual C++ Control Developers Kit. Specifically, the programmer will be required
to understand some of the fundamentals of OLE automation and dual interfaces. The
user will have to be able to understand and modify an .ODL file on their own.
In addition, the user will be required to understand and be able to work with
OLE persistence interfaces, most notably IStream IPersistPropertyBag and
IPersistStream. However, if it is not desired, the user will not be required
to have much knowledge of OLE embedding interfaces.
Programmers who do not have specific performance requirements, those not familiar
with many of the pertinent OLE technologies, or those who work primarily with the
Microsoft Foundation Classes will find the MFC/CDK far more suited to their needs.
1.2 Structure of the Framework
The directory structure of the ActiveX Controls Framework is as follows:
BaseCtl +
|- \FrameWrk
|
|- \IELnk
|
|- \IEMIME
|
|- \Include
|
|- \Lib
|
|- \ToDoSvr
|
+- \WebImage
The BaseCtl\Framewrk and BaseCtl\Include directories contain the core code for
writing an ActiveX control. The BaseCtl\Include directory contains the headers
that most controls will get their information from, and the BaseCtl\Framewrk
directory contains the core functionality (in the COleControl class) which compiles
into a static library (.LIB) form.
A few samples are provided with the framework.
1.3 Target Environment
This framework was developed assuming you have the Microsoft Visual C++ 4.0 (or later)
toolset in your path and the Microsft Windows Platform SDK installed. Running 'nmake'
in BaseCtl or BaseCtl\FrameWrk will build debug a version of the static library.
'nmake nodebug=1' will build a retail (nodebug) static library.
All of the makefiles and build processes are command-line based. Various people have
reported, however, that it's largely trivial to integrate that into their favorite
environments.
NOTE: Under Windows 95, Visual C++ will not, by default, register its environment
variables to set up for command line builds. Occasionally on some Windows 95 machines
you may get a bunch of "Out of Environment Space" messages when doing this. In the
properties dialog for the Command Prompt, you can increase the size of the environment
from "Auto" to some number like 1024, and this takes care of the problem. None of this
should happen when developing under Microsoft Windows NT.
The file dwinvers.h in <sdkdir>\samples\com\activexcontrol\BaseCtl\Framewrk is a
file that contains version and copyright information that should be updated by you
each time you run your builds. The framework does not do this work for you.
2.0 Creating an ActiveX Control
=-------------------------=
Creating an ActiveX control using this framework proves moderately straightforward.
We will go into the process in brief here. Templating off the sample code should be
able to fill in the holes.
The framework implements the core functionality in a few C++ classes, notably
CAutomationObject, COleControl (which inherits from CAutomationObject), and
CPropertyPage. All objects inherit from CUnknownObject, which provides the
support for aggregation.
So, to write an ActiveX Control, you need to declare a new object which inherits
from COleControl. In addition, you'll need to inherit from some sort of Automation
interface that describes the properties and methods for your control, say, IMyControl.
This interface description is generated by MKTYPLIB and will be put in some output
file created by MKTYPLIB. COleControl has a number of virtual methods that are
declared as pure, which you simply must implement in your control class. These
include WindowProc, LoadBinaryState, LoadTextState, SaveBinaryState, SaveTextState,
OnDraw, and RegisterClassData.
To write a property page, you declare a new object which inherits from CPropertyPage.
This object must implement a DialogProc. You can also implement automation objects
and collections by declaring a new object that inherits from CAutomationObject.
Since an ActiveX control is an In-Process OLE Server, you also need one file to
describe all your objects, whether they be controls, automation objects, or property
pages. This file will have a bunch of information in it, including a table of all
objects and information about them. In addition, it'll have information on what
sort of localization your server would like to use, and what sort of licensing
support you'd like to have.
Finally, you'll need
没有合适的资源?快使用搜索试试~ 我知道了~
MSDN Library Visual Studio 6.0 disk1
共2000个文件
h:4715个
cpp:3781个
c:1569个
需积分: 3 6 下载量 97 浏览量
2023-05-26
20:33:57
上传
评论
收藏 762.34MB ZIP 举报
温馨提示
新特性 新的 MSDN 查阅器 MSDN Library Visual Studio 6.0 是第一个采用 HTML Help 查阅器技术的 Library 版本。要参阅查阅器帮助,请单击 MSDN 菜单上的“帮助”,然后单击 “MSDN Library 帮助”。 安装问题 一般安装信息 您无需卸载使用 InfoViewer 5.0 技术的早期版本的 MSDN Library。例如,July 1998 MSDN Library 和所有更早的 MSDN Library 可以与 MSDN Library Visual Studio 6.0 同时存在。如果您的确需要卸载 MSDN Library,请使用“控制面板”中的“添加/删除程序”或所要卸载的 MSDN Library 的光盘上的安装程序。 如果用于安装 MSDN Library 的机器,曾经安装过 MSDN Library Visual Studio 6.0,或它的测试版,请确认文件 Hh.dat 已被删除,该文件在 \WINNT 或 \WIN95 目录下。如果还在,请先手工删除或移到别处,然后开始安装。 典型、
资源推荐
资源详情
资源评论
收起资源包目录
MSDN Library Visual Studio 6.0 disk1 (2000个子文件)
STLCOLL_P.C 313KB
QUIKTEST.C 220KB
MSPFLD.C 151KB
WINDS_S.C 150KB
WINDS_S.C 150KB
JULIA.C 146KB
ADOSAMP_P.C 139KB
DXVIEW.C 135KB
WINDS_C.C 127KB
WINDS_C.C 127KB
CNTRLINE.C 120KB
REITP.C 115KB
CLIPBRD.C 114KB
OLEAPP.C 109KB
AVIEDIT.C 100KB
MSPMS.C 100KB
INFO.C 100KB
WDSADM_S.C 98KB
XPBASE.C 96KB
WINDIFF.C 93KB
OUTLDOC.C 93KB
WDSADM_C.C 92KB
OLESTD.C 90KB
MAIN.C 85KB
CHECK_SD.C 84KB
CHILD.C 83KB
CMCCLI.C 81KB
DLCDEBUG.C 79KB
SMHPS.C 78KB
SHELL.C 77KB
AAFILE.C 77KB
DRVPROC.C 77KB
CPICERR.C 76KB
MSENDRCV.C 76KB
MSPMSG.C 75KB
LOG.C 75KB
WRUI3270.C 74KB
STDDDE.C 73KB
STDDDE.C 73KB
D3DEX2.C 73KB
WSLI3270.C 72KB
RUI3270.C 72KB
DEBDEBUG.C 72KB
D3DEX1.C 70KB
MCIAPP.C 70KB
VIDCAP.C 70KB
SLI3270.C 70KB
PAPINT_P.C 69KB
PERFDATA.C 69KB
AACHOOSE.C 69KB
ROUTE.C 69KB
CNTRBASE.C 69KB
CNTRINPL.C 68KB
ALERT.C 67KB
CRP.C 66KB
SVRBASE.C 65KB
DIALOGS.C 65KB
FONTLOAD.C 65KB
AVIVIEW.C 65KB
MAPIDBG.C 64KB
PROCSRV.C 64KB
CLIENT.C 63KB
MMCAPS.C 63KB
IDB_P.C 63KB
PDC.C 63KB
MSPLOGON.C 63KB
TTY.C 62KB
ADDLINE.C 61KB
LINKING.C 61KB
WMFMETA.C 61KB
DSSTREAM.C 60KB
REPORT.C 60KB
RPCSVC_C.C 60KB
XPSTATUS.C 59KB
SELECT.C 59KB
DIBS.C 59KB
DRAG.C 58KB
SIDCLEAN.C 58KB
STYLES.C 57KB
STATUS.C 56KB
TOOLBAR.C 55KB
RPCSVC_S.C 55KB
ACMAPP.C 54KB
XPQUEUE.C 54KB
GLOBALS.C 54KB
FFDONUTS.C 52KB
CLIENT.C 52KB
FONTVIEW.C 51KB
DONUTS.C 51KB
MDICHILD.C 51KB
MDICHILD.C 51KB
XPRCVMSG.C 51KB
SIMPLEX.C 51KB
RPTFCT.C 51KB
MRCV.C 50KB
GAMEPROC.C 50KB
ADMNDEMO.C 50KB
APP.C 49KB
WORKWP.C 49KB
FILER.C 49KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
mekelly
- 粉丝: 4
- 资源: 21
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功