Initialization and ActiveX control templates ".
Note:This article does not cover how to mark the control as secure download. For more information about code download and $ code signature, see Internet client SDK. Go back to the top. For more information, follow these steps to mark your MFC ActiveX control as a secure operation for Script Security and initialization:
Add the following cathelp. h and cathelp. cpp files to your project to implement the helper function of CreateComponentCategory
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,
array. When dllgetclassobject requests a factory class object, it searches for this array to see if there is a factory class object that matches clsid. When it finds a matched CLSID, it creates a class factory object and returns the class factory pointer to cogetclassobject. Then the client can call iclassfactory based on the class factory pointer returned :: the createinstance method creates a component, and the class factory creates a COM component based on the methods defined in the array.
T
, cparticle is not very complicated. It has a series of public variables, the attributes of the particles-set the default value through the constructor, And the inline function executes the update. Don'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 ~ Cparti
Donuts from Microsoft
//-----------------------------------------------------------------------------// File: filewatch. cpp//// Copyright (c) Microsoft Corporation. All rights reserved.//-----------------------------------------------------------------------------# Include "stdafx. H"
//-----------------------------------------------------------------------------// Name:// Desc://-----------------------------------------------------------------------------Cfilewatch: cfilewatch (){M_nfilestowa
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 specifies whether the interface is derived from iunknown or idispatch.
4. preservesig, which specifies whether the native return value should be converted from hresult to. NET Framework exception.Section 6 Interface Conversion
C # not only supports the. NET
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
dllgetclassobject requests a factory class object, it searches for this array to see if there is a factory class object that matches clsid. When it finds a matched CLSID, it creates a class factory object and returns the class factory pointer to cogetclassobject. Then the client can call iclassfactory based on the class factory pointer returned :: the createinstance method creates a component, and the class factory creates a COM component based on the methods defined in the array.
The factory t
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, Olectrls, SHDOCVW, stdctrls,mshtm L, Extctrls, Comctrls, Idbasecomponent, Idcomponent, Idtcpconnection, Id
();};
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_com(m_anim_controller);
delete m_alloc_hierarchy;}
The main task of the load_from_xfile () function is
and potentially unnecessary parts, such as com registration, runtime service, proxy, thread model, and mail handling.
Create an XML reader and writer for functions exported from xmllite. dll. Link to xmllite. lib and include the xmllite. h header file in the Windows SDK to access them. The generated com style interface uses the familiar iunknown interface method to manage the lifetime. The com istream interface also plays a role and indicates memory. In addition, there is no com dependency; no
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
, 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 obtain the display information from the cache. Otherwise, you need to obtain it from the file again.
Void cpicviewview: ongetdispinfo (nmhdr * pnmhdr, lresult * presult){Lv_disp
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 | dochostuiflag_scroll_no | dochostuiflag_no3douterborder;Return s_ OK;}
Here we also set the dochostuiflag_scroll_no flag to remove the scroll bar on the right. dochostuiflag_no3douterborder to remove
: IUnknown{public: virtual HRESULT STDMETHODCALLTYPE Add( const int nNum1, const int nNum2, int *pnSum ) const = 0; virtual HRESULT STDMETHODCALLTYPE Sub( const int nMinuend, const int nSubtrahend, int *pnQuotient ) const = 0;};
There is no problem with this, and there will be no problems when using some smart pointers. For ex
. 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 not know about this operation, please read the "fifth return" or "Sixth return" again ".3-2,View the IDL file. After completing the previous step, open the IDL file with the following content: (the nam
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.