7. com_interface_entry_autoaggregate (IID, punk, CLSID) parameter ATL routine commap
Let's take a look at the macro definition:# Define com_interface_entry_autoaggregate (IID, punk, CLSID )/{ IID ,/(DWORD) _ ccomcachedata (DWORD) offsetof (_ commapclass, punk )/>: Data ,/_ Cache },Let's take a look at its typical usage:Class cautoagg:Public idispatchimpl,Public isupporterrorinfo,Public ccomobjectroot,Public ccomcoclass{............};Similar to general components.Class couter:Public cchainbase,
component, and the class factory creates a COM component based on the methods defined in the array.
The factory template contains the following variables:
Const wchar * m_name; // nameConst CLSID * m_clsid; // CLSIDLpfnnewcomobject m_lpfnnew; // function to create an instance of the componentLpfninitroutine m_lpfninit; // initialization function (optional)Const amoviesetup_filter * m_pamoviesetup_filter; // set-up information (for filters)The two function pointers m_lpfnnew and m_lpfninit use t
worry about updating functions-you will know how it works later. Now let's look at cparticle's mother cparticleemitter.
Cparticleemitter
This class contains our particle array, using particle attributes (gravity, texture, etc)
Class cparticleemitter
{Public: cparticleemitter (); Virtual ~ Cparticleemitter (); Virtual void Update (float felapsedtime, float ftimedelta); Virtual hresult render (); Virtual hresult
Donuts from Microsoft
//-----------------------------------------------------------------------------// File: filewatch. cpp//// Copyright (c) Microsoft Corporation. All rights reserved.//-----------------------------------------------------------------------------# Include "stdafx. H"
//-----------------------------------------------------------------------------// Name:// Desc://-----------------------------------------------------------------------------Cfilewatch: cfilewatch (){M_nfilestowa
Type Library ). In these cases, another method is to manually define the com definition in the C # source code using the C # attribute. After creating a C # source ing, you only need to compile the C # source code to generate a hosted package.
Main attributes to be understood when executing com ing include:
1. comimport: it marks the class as an external com class.
2. guid: it is used to specify a universal unique identifier (UUID) for a class or interface ).
3. interfacetype, which spec
contained object only needs to implement a lightweight iobjectwithsite interface. This interface provides the following methods:Table 3 iobjectwithsite DefinitionMethod descriptionHresult setsite (iunknown * punksite) receives the iunknown pointer from IE. A typical implementation is to save the pointer for future use ..Hresult getsite (refiid riid, void ** ppvsite) receives and returns the specified interface from the location set through setsite, A
class factory creates a COM component based on the methods defined in the array.
The factory template contains the following variables: const wchar * m_name; // nameConst CLSID * m_clsid; // CLSIDLpfnnewcomobject m_lpfnnew; // function to create an instance of the componentLpfninitroutine m_lpfninit; // initialization function (optional)Const amoviesetup_filter * m_pamoviesetup_filter; // set-up information (for filters)The two function pointers m_lpfnnew and m_lpfninit use the following defini
URL is required address begin myDocument: = (pdisp as IWebBrowser2). Document as IHTMLDocument2; End END;
Four, get IHTMLDocument2 how to operate
Procedure Tmyform.btlogoutclick (Sender:tobject); var myform:ihtmlformelement; Begin if assigned (myDocument) THEN BEGIN if rightposex (' Judge page title ', Mydocument.title)
Prohibit the Page Pop-up dialog box (mainly is the CSDN forum a Warrior's method)
Uses Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms, Dialogs, Olect
area. The detailed steps for this example are as follows:(1) Create a default single document program Project Ex_image.(2) Open the include file atlimage.h that adds the CImage class to the StdAfx.h file.(3) Add the command event Mapper for the Id_file_open in the Cex_imageview class and add the following code:Program code:
void Cex_imageview::onfileopen ()
{
CString strfilter;
CSimpleArray HRESULT HRESULT
one of the simplest COM objects. The component class is called Atlcomserver, and the implementation interface is called Iatlcomserver, and the library name
ATLServer. Add a property name and implement the Get/set function. The IDL looks like the following:
Import "Oaidl.idl";
Import "Ocidl.idl";
[
Object
UUID (77506E08-D9FB-4F45-85E0-376F5187AF21),
Dual
Nonextensible,
helpstring ("Iatlcomserver Interface"),
Pointer_default (Unique)
]
Interface iatlcomserver:idispatch{
[Propget, ID (1), helps
This series of articles by Net_assassin finishing, reproduced please indicate the source.
http://blog.csdn.net/net_assassin/article/category/1100363
Author: Net_assassin e-mail: net_assassin@hotmail.com look forward to interacting with like-minded friends
ID3DXSprite objects are a great surprise to programmers who plan to use Direct3D to write 2D games.
The advantage of this is that the full 3D renderer is ready to serve you at the same time as the previous implementation (DirectDraw) a
D3DXMATRIX* mat_world, double app_elapsed_time);void destroy();
public:cAnimMesh();virtual ~cAnimMesh();};
The constructor is responsible for allocating resources and initializing member variables. The Destructor is responsible for releasing resources:
cAnimMesh::cAnimMesh(){m_is_play_anim = true;m_device = NULL;m_anim_controller = NULL;m_root_frame = NULL;
m_alloc_hierarchy = new cAllocateHierarchy();}
cAnimMesh::~cAnimMesh(){D3DXFrameDestroy(m_root_frame, m_alloc_hierarchy);release_c
need to register any COM class or even call a mandatory coinitialize function. The Active Template Library (ATL) ccomptr class processes a small portion of the remaining COM. However, you do need to pay attention to thread security because xmllite is NOT thread-safe due to the performance in the single-thread solution.
In the following example, I use the com_verify macro to clearly identify where the method returns the hresult to be checked. You can
Let's not talk about anything else.
Code , The code is very simple, do not understand the message.
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1 Using System; 2 Using System. Collections. Generic; 3 Using System. LINQ; 4 Using System. text; 5 Using System. runtime. interopservices; 6 Using Mshtml; 7 Using System. Threading; 8 Using System. runtime. interopservices. comtypes; 9 Using System. I
){Nmlvcachehint * pcachehint = (nmlvcachehint *) pnmhdr;Prepcache (0, min (5, m_arpfolderitems.getsize ()));Prepcache (pcachehint-> ifrom, pcachehint-> ITO );Prepcache (max (0, m_arpfolderitems.getsize ()-5), m_arpfolderitems.getsize ());* Presult = 0;}Before a project needs to be displayed in the list, the list will send an lvn_getdispinfo notification. The application can capture this message to provide project display information. If the list items to be displayed are in the cache, you can ob
method is from atliface. in the H file, all method declarations are attached. all implementations are written as {return e_notimpl;}. Do not forget to implement gethostinfo (). This is the purpose of implementing the idochostuihandlerdispatch:
Virtual hresult stdmethodcalltype gethostinfo (/* [Out] [in] */DWORD _ rpc_far * pdwflags,/* [Out] [in] */DWORD _ rpc_far * pdwdoubleclick){Atltrace ("called gethostinfo/N ");* Pdwflags = dochostuiflag_theme |
user does not know the existence of the new interface imathe2, and he still uses the old interface imathe; while the new user can discard imathe and directly use the new interface function of imathe2. Look, how smooth the upgrade is!
Iii. Implementation3-1,First, Use ATL to implement a COM component of the custom (M m) interface imathe, and complete the add () integer addition function in the interface.Note !!!It must be a custom interface (dual interface will be introduced later ). If you do n
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.