亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch13.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
Classes and the Visual C++ AppWizard do much of the behind-the-scenes work for you.
The discussion in these chapters is just what you need to know to use COM as a developer.</P>
<P>COM is a binary standard for Windows objects. That means that the executable code
(in a DLL or EXE) that describes an object can be executed by other objects. Even
if two objects were written in different languages, they are able to interact using
the COM standard.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> Because the code in a DLL executes in the same process as the calling
	code, it's the fastest way for applications to communicate. When two separate applications
	communicate through COM, function calls from one application to another must be <I>marshaled</I>:
	COM gathers up all the parameters and invokes the function itself. A standalone server
	(EXE) is therefore slower than an in-process server (DLL).&#160;
<HR>


</BLOCKQUOTE>

<P>How do they interact? Through an <I>interface</I>. An ActiveX interface is a collection
of functions, or really just function names. It's a C++ class with no data, only
pure virtual functions. Your objects inherit from this class and provide code for
the functions. (Remember, as discussed in Appendix A, &quot;C++ Review and Object-Oriented
Concepts,&quot; a class that inherits a pure virtual function doesn't inherit code
for that function.) Other programs get to your code by calling these functions. All
ActiveX objects must have an interface named IUnknown (and most have many more, all
with names that start with I, the prefix for interfaces).</P>
<P>The IUnknown interface has only one purpose: finding other interfaces. It has
a function called QueryInterface() that takes an interface ID and returns a pointer
to that interface for this object. All the other interfaces inherit from IUnknown,
so they have a QueryInterface() too, and you have to write the code--or you would
if there was no MFC. MFC implements a number of macros that simplify the job of writing
interfaces and their functions, as you will shortly see. The full declaration of
IUnknown is in Listing 13.1. The macros take care of some of the work of declaring
an interface and won't be discussed here. There are three functions declared: QueryInterface(),
AddRef(), and Release(). These latter two functions are used to keep track of which
applications are using an interface. All three functions are inherited by all interfaces
and must be implemented by the developer of the interface.</P>
<P>
<H4>Listing 13.1&#160;&#160;IUnknown, Defined in \Program Files\Microsoft Visual
Studio\VC98\Include\unknwn.h</H4>
<PRE>MIDL_INTERFACE(&quot;00000000-0000-0000-C000-000000000046&quot;)
   IUnknown
    {
    public:
        BEGIN_INTERFACE
        virtual HRESULT STDMETHODCALLTYPE QueryInterface(
            /* [in] */ REFIID riid,
            /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) = 0;
        virtual ULONG STDMETHODCALLTYPE AddRef( void) = 0;
        virtual ULONG STDMETHODCALLTYPE Release( void) = 0;
#if (_MSC_VER &gt;= 1200)   // VC6 or greater
      template &lt;class Q&gt;
      HRESULT STDMETHODCALLTYPE QueryInterface(Q** pp)
      {
         return QueryInterface(__uuidof(Q), (void**)pp);
      }
#endif
        END_INTERFACE
</PRE>
<PRE>    };
</PRE>
<H2><A NAME="Heading7"></A>Automation</H2>
<P>An Automation server lets other applications tell it what to do. It <I>exposes</I>
functions and data, called <I>methods</I> and <I>properties</I>. For example, Microsoft
Excel is an Automation server, and programs written in Visual C++ or Visual Basic
can call Excel functions and set properties like column widths. That means you don't
need to write a scripting language for your application any more. If you expose all
the functions and properties of your application, any programming language that can
control an Automation server can be a scripting language for your application. Your
users may already know your scripting language. They essentially will have no learning
curve for writing macros to automate your application (although they will need to
learn the names of the methods and properties you expose).</P>
<P>The important thing to know about interacting with automation is that one program
is always in control, calling the methods or changing the properties of the other
running application. The application in control is called an Automation controller.
The application that exposes methods and functions is called an Automation server.
Excel, Word, and other members of the Microsoft Office suite are Automation servers,
and your programs can use the functions of these applications to really save you
coding time.</P>
<P>For example, imagine being able to use the function called by the Word menu item
Format, Change Case to convert the blocks of text your application uses to all uppercase,
all lowercase, sentence case (the first letter of the first word in each sentence
is uppercase, the rest are not), or title case (the first letter of every word is
uppercase; the rest are not).</P>
<P>The description of how automation really works is far longer and more complex
than the interface summary of the previous section. It involves a special interface
called IDispatch, a simplified interface that works from a number of different languages,
including those like Visual Basic that can't use pointers. The declaration of IDispatch
is shown in Listing 13.2.</P>
<P>
<H4>Listing 13.2&#160;&#160;IDispatch, Defined in \Program Files\Microsoft Visual
Studio\VC98\Include\oaidl.h</H4>
<PRE>MIDL_INTERFACE(&quot;00020400-0000-0000-C000-000000000046&quot;)
    IDispatch : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(
            /* [out] */ UINT __RPC_FAR *pctinfo) = 0;
        virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(
            /* [in] */ UINT iTInfo,
            /* [in] */ LCID lcid,
            /* [out] */ ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo) = 0;
        virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(
            /* [in] */ REFIID riid,
            /* [size_is][in] */ LPOLESTR __RPC_FAR *rgszNames,
            /* [in] */ UINT cNames,
            /* [in] */ LCID lcid,
            /* [size_is][out] */ DISPID __RPC_FAR *rgDispId) = 0;
        virtual /* [local] */ HRESULT STDMETHODCALLTYPE Invoke(
            /* [in] */ DISPID dispIdMember,
            /* [in] */ REFIID riid,
            /* [in] */ LCID lcid,
            /* [in] */ WORD wFlags,
            /* [out][in] */ DISPPARAMS __RPC_FAR *pDispParams,
            /* [out] */ VARIANT __RPC_FAR *pVarResult,
            /* [out] */ EXCEPINFO __RPC_FAR *pExcepInfo,
            /* [out] */ UINT __RPC_FAR *puArgErr) = 0;
</PRE>
<PRE>    };
</PRE>
<P>Although IDispatch seems more complex than IUnknown, it declares only a few more
functions: GetTypeInfoCount(), GetTypeInfo(), GetIDsOfNames(), and Invoke(). Because
it inherits from IUnknown, it has also inherited QueryInterface(), AddRef(), and
Release(). They are all pure virtual functions, so any COM class that inherits from
IDispatch must implement these functions. The most important of these is Invoke(),
used to call functions of the Automation server and to access its properties.</P>
<P>
<H2><A NAME="Heading8"></A>ActiveX Controls</H2>
<P>ActiveX controls are tiny little Automation servers that load <I>in process</I>.
This means they are remarkably fast. They were originally called OLE Custom Controls
and were designed to replace VBX controls, 16-bit controls written for use in Visual
Basic and Visual C++. (There are a number of good technical reasons why the VBX technology
could not be extended to the 32-bit world.) Because OLE Custom Controls were traditionally
kept in files with the extension .OCX, many people referred to an OLE Custom Control
as an OCX control or just an OCX. Although the OLE has been supplanted by ActiveX,
ActiveX controls produced by Visual C++ 6.0 are still kept in files with the .OCX
extension.</P>
<P>The original purpose of VBX controls was to allow programmers to provide unusual
interface controls to their users. Controls that looked like gas gauges or volume
knobs became easy to develop. But almost immediately, VBX programmers moved beyond
simple controls to modules that involved significant amounts of calculation and processing.
In the same way, many ActiveX controls are far more than just controls; they are
<I>components</I> that can be used to build powerful applications quickly and easily.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE:</strong> If you have built an OCX in earlier versions of Visual C++, you might
	think it is a difficult thing to do. The Control Developer Kit, now integrated into
	Visual C++, takes care of the ActiveX aspects of the job and allows you to concentrate
	on the calculations, display, or whatever else it is that makes your control worth
	using. The ActiveX Control Wizard makes getting started with an empty ActiveX control
	simple.
<HR>


</BLOCKQUOTE>

<P>Because controls are little Automation servers, they need to be used by an Automation
controller, but the terminology is too confusing if there are controls and controllers,
so we say that ActiveX controls are used by <I>container</I> applications. Visual
C++ and Visual Basic are both container applications, as are many members of the
Office suite and many non-Microsoft products.</P>
<P>In addition to properties and methods, ActiveX controls have <I>events</I>. To
be specific, a control is said to <I>fire</I> an event, and it does so when there
is something that the container needs to be aware of. For example, when the user
clicks a portion of the control, the control deals with it, perhaps changing its
appearance or making a calculation, but it may also need to pass on word of that
click to the container application so that a file can be opened or some other container
action can be performed.</P>

<P>This chapter has given you a brief tour through the concepts and terminology used
in ActiveX technology, and a glimpse of the power you can add to your applications
by incorporating ActiveX into them. The remainder of the chapters in this part lead
you through the creation of ActiveX applications, using MFC and the wizards in Visual
C++.</P>
<H1></H1>
<CENTER>
<P>
<HR>
<A HREF="../ch12/ch12.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch14/ch14.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <BR>
<BR>
</P>

<P>&#169; <A HREF="../copy.htm">Copyright</A>, Macmillan Computer Publishing. All
rights reserved.
</CENTER>


</BODY>

</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃视频一区二区三区在线观看| 日韩一区二区影院| 久久这里只有精品视频网| 亚洲一区二区视频| 91久久精品网| 成人免费在线播放视频| 国产91色综合久久免费分享| 久久亚洲综合色| 极品少妇xxxx精品少妇偷拍| 日韩欧美不卡一区| 蜜桃av一区二区| 欧美本精品男人aⅴ天堂| 久久99国产精品免费网站| 欧美va亚洲va香蕉在线| 精品一区二区三区久久| 国产亚洲欧美日韩在线一区| 国产69精品久久99不卡| 国产精品色眯眯| 91免费版在线| 亚洲永久精品国产| 91麻豆精品国产91久久久久久 | 日韩三级中文字幕| 久久精品国产**网站演员| 日韩一级完整毛片| 高清国产一区二区| 亚洲日本欧美天堂| 欧美久久久久久久久中文字幕| 日韩高清不卡在线| 久久免费午夜影院| 不卡电影免费在线播放一区| 亚洲欧美aⅴ...| 欧美揉bbbbb揉bbbbb| 蜜臀av一区二区三区| 国产日产欧美一区| 在线观看国产91| 日本欧美一区二区| 日本一区二区三区视频视频| 日本久久一区二区三区| 日日夜夜免费精品视频| 久久久久久久久久久久久久久99| 不卡免费追剧大全电视剧网站| 亚洲国产精品天堂| 欧美精品一区二区三区视频 | 91精品视频网| 国产揄拍国内精品对白| 亚洲免费观看高清完整版在线观看 | 91精品国产综合久久精品麻豆| 麻豆精品视频在线观看| 亚洲国产精华液网站w| 一本色道久久综合亚洲精品按摩| 亚洲成人手机在线| 久久先锋资源网| 91高清视频在线| 国产精品资源站在线| 洋洋av久久久久久久一区| 欧美xfplay| 欧美在线观看视频在线| 国产成人在线电影| 日韩一区精品字幕| 亚洲精品一二三四区| 久久精品夜色噜噜亚洲a∨| 欧美日韩亚洲综合一区二区三区| 国产福利一区二区三区视频| 亚洲图片激情小说| 国产视频一区二区三区在线观看| 色综合久久99| 国产成人av电影在线| 久久国产夜色精品鲁鲁99| 伊人婷婷欧美激情| 国产精品久久久久一区| 欧美性受极品xxxx喷水| 国产在线不卡视频| 男女视频一区二区| 午夜精品久久久久久久久久久 | 国产xxx精品视频大全| 日韩av一级片| 亚洲一区二区在线视频| 亚洲天天做日日做天天谢日日欢| 亚洲精品一线二线三线无人区| 欧美日韩黄视频| 93久久精品日日躁夜夜躁欧美| 国产激情视频一区二区在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎 | 国产一区视频网站| 日韩va欧美va亚洲va久久| 亚洲国产精品综合小说图片区| 国产精品日韩精品欧美在线| 欧美一区二区三区小说| 91国产丝袜在线播放| 国产大片一区二区| 国产91露脸合集magnet| 成人午夜精品在线| 国产精选一区二区三区| 激情综合网av| 国产真实乱偷精品视频免| 极品销魂美女一区二区三区| 久久99热99| 国内久久精品视频| 国产精品 日产精品 欧美精品| 韩国av一区二区三区| 国产一区二区三区免费播放| 国产一区二区三区av电影| 国产一区三区三区| 国产成人三级在线观看| 成人午夜看片网址| av激情综合网| 日本高清免费不卡视频| youjizz国产精品| 岛国av在线一区| 99久久精品国产麻豆演员表| 99精品视频在线观看免费| 色狠狠一区二区| 欧美色视频在线| 欧美久久久久中文字幕| 91精品国产一区二区三区香蕉| 欧美一区二区免费观在线| 日韩一区二区影院| 久久久久久夜精品精品免费| 国产精品欧美久久久久无广告| 亚洲品质自拍视频网站| 亚洲国产日韩一区二区| 亚洲一区二区三区免费视频| 中文字幕在线一区| 亚洲欧美激情视频在线观看一区二区三区| 亚洲精品欧美激情| 亚洲午夜久久久久| 蜜臀a∨国产成人精品| 成人在线综合网站| 欧美日韩视频专区在线播放| wwww国产精品欧美| 亚洲天堂免费在线观看视频| 日韩电影在线看| 夫妻av一区二区| 欧美日韩视频专区在线播放| 久久亚洲欧美国产精品乐播| 亚洲三级在线看| 日本不卡在线视频| 成人av在线播放网址| 91.麻豆视频| 中文字幕国产一区| 舔着乳尖日韩一区| 成人av片在线观看| 欧美一卡在线观看| 亚洲欧美国产77777| 国产精品一区二区三区乱码| 欧美精品高清视频| 国产精品久久久久影院老司 | 日韩午夜在线影院| 一区二区中文视频| 久久精品国产网站| 欧美视频中文字幕| 中文字幕不卡在线观看| 捆绑紧缚一区二区三区视频| 欧美天天综合网| 精品一区二区三区在线观看国产| 91蜜桃免费观看视频| 久久婷婷色综合| 亚洲欧洲99久久| 美女国产一区二区三区| 91一区在线观看| 成人国产免费视频| 成人av中文字幕| 欧美写真视频网站| 日韩欧美激情一区| 亚洲影视在线播放| av动漫一区二区| 久久久99精品免费观看| 免费观看久久久4p| 欧美日韩三级视频| 一区二区三区中文字幕在线观看| 成人国产精品免费观看视频| 久久久天堂av| 黄色精品一二区| 欧美mv日韩mv国产网站app| 五月天丁香久久| 欧美日韩aaa| 日韩国产在线一| 欧美日韩国产bt| 午夜婷婷国产麻豆精品| 欧美日韩国产三级| 偷拍日韩校园综合在线| 欧美日韩一区三区四区| 亚洲sss视频在线视频| 欧美日韩在线一区二区| 亚洲伊人伊色伊影伊综合网| 色欧美日韩亚洲| 亚洲午夜久久久久久久久电影院| 欧美三区在线观看| 五月婷婷久久综合| 欧美午夜精品一区二区蜜桃| 最好看的中文字幕久久| 国产a级毛片一区| 中文字幕亚洲在| 色婷婷综合久久久久中文| 一区二区高清免费观看影视大全 | 国产揄拍国内精品对白| 久久网站最新地址| eeuss鲁片一区二区三区在线观看| 亚洲色欲色欲www在线观看| 色婷婷综合五月|