annotations in The IDL file. These annotations will be saved ***. H and *** _ I. in the c file, [in] indicates that this parameter is an input parameter [out], indicating that this parameter is an output parameter [iid_is (riid)], indicating that this parameter requires the previous riid parameter.
Note: All parameters with the out attribute must be pointer type.
1.3 iunkown Interface
In the entire example, except for the iunkown, other things should not be unfamiliar! Com requirements (the mos
, the COM object is destroyed. When another pointer obtains this COM object, the count will be increased. If a pointer releases control over this COM object, the count will be reduced by one. This counting method is similar to a smart pointer. However, the Count of COM objects is not as intelligent as the pointer, and sometimes needs to be released manually. Therefore, users are responsible for releasing resources. Based on the above statement, we need an interface for getting all other interfac
the ATL register. To comtoys, I just moved the code from bandobj to comtoys. Comtoys uses ctmodule, ctfactory, and a special file dllentry. cpp to process object creation, registration, and DLL entries. Ctmodule is a typical "module class", just like the cwinapp of MFC or the ccommodule of ATL. Among them, virtual functions such as ongetclassobject and ondllregisterserver can be reloaded. However, you must include (# include) The dllentry. cpp that implements the DLL entry.
extern "C" STDAPI D
, BitTorrent, box.net, Chacha, Google, Pando, Windows Live Search, Yahoo! Search, and yousendit
Entertainment: desktop tower defense, eventful, gamegum, homestar runner, line rider, newsgrounds, revision3, stardoll, Yahoo! Bix, and you don't know jack
Multimedia: Flickr, fotki, last. FM, Netflix, Pandora, Photobucket, ustream. TV, Yahoo! Video, YouTube, and zooomr
Mobile applications: 1-800-goog-411, 3jam, Google Gmail mobile, Google Maps mobile
Nowadays, we are in an image transmission, the image not only become an important way of communication, but also become an important narrative way. Image narration is a kind of appeal to the visual form, which dispels the audience's deep reading and rational thinking, and directs the perception of people's world to the intuitive response of the visual object. Therefore, today's brand communication and performance has been profoundly marked by the visual narrative. Here are 14 visual narrative si
* bp=( (unsigned char *) This + offsetof (iaudiocard, Speaker ));
QueryInterface, addref, and release of our sub-objects
Because each sub-object also exists directly inside our iaudiocard, the sub-object can also be located using pointer calculation (imicin ). For example, the QueryInterface of ispeakerout can call the queryinerface of imicin (assume that "This" is ispeakerout) as follows ):
IMicIn *base; base = (IMicIn *)((unsigned char *)this - offsetof(IAudioCard,speaker)); base->
, just like using a conventional C ++ object pointer.
Create a COM Object
To create a COM Object and obtain an interface from this object, you must call the API function of the COM library, cocreateinstance (). The prototype is as follows:
HRESULT CoCreateInstance ( REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv );
The following describes the parameters:
Rclsid: CLSID of coclass. For example
the ground is open with red flowers ... The students who will sing this song please raise their hands, each reward Vckbase experts 500!Third, the caller's implementationWhen we read MSDN about IPersistPropertyBag interface functions, you'll find that you also need an interface ipropertybag to work with to implement property bag functionality. IPropertyBag, however, requires us to implement the interface in the caller (container). The relationship between them is as follows:In the preceding few
)STDMETHODIMP Csink::queryinterface (const struct _GUID iid,void * * PPV) {*ppv=this;return S_OK;} ULONG __stdcall csink::addref (void) {return 1;} Just make a fake, because this object will not quit before the program ends. ULONG __stdcall Csink::release (void) {return 0;} Make a fake, because this object will not exit before the end of the program Stdmethodimp csink::gettypeinfocount (unsigned int *) {ret
re-read it again from "fourth back". (Note 2)3. Here are just a few highlights. We need to add the "sink" object in the caller's project. Remember the way you added the callback receiver object to the last book? On the last, our callback interface was inherited from IUnknown. In this case, because our component is a dual interface (Dual), the connection point is also a dual interface, so this time our receiver will be derived from IDispatch.4, complete the CSink class interface function (virtua
explain how the receiver is structured:Figure VII Derivation of the receiver class from Icallback CSinkHere Icallback is COM interface, so csink can not be instantiated, if you go to compile, will get a lump (note 3) error, report that you did not implement the virtual function. Then, we can follow the error report to implement all the virtual functions:STDMETHODIMP is a macro, equivalent to long __stdcallstdmethodimp csink::queryinterface (const struct _GUID iid,void * *
Split view is one of the most common layouts in a tablet computer. It consists of two side panes. Of course, you can add panes for more complex layouts.
Ustream Split view, Category option on left, content on right.
Embedded Multimedia
Two platforms are allowed to embed audio, video and maps.
Youtube apps, with embedded video players.
Clip Board
supports the copying and pasting of information inside and outside the appl
installation procedures)
Copy Code code as follows:
Apt-get Install Libreadline-dev libncurses5-dev libpcre3-dev Libssl-dev perl
3, download ngx_openresty-1.7.7.2.tar.gz and decompression
Copy Code code as follows:
wget http://openresty.org/download/ngx_openresty-1.7.7.2.tar.gz
TAR-XZVF ngx_openresty-1.7.7.2.tar.gz
The Ngx_openresty-1.7.7.2/bundle directory contains the Nginx core and many third-party modules, such as the LUA and Luajit we n
() {D *pd = new D; B *PB = dynamic_castThis is when I get a pointer to IUnknown when I implement QueryInterface, using *PPV = Static_castDynamic_cast's Discussion:Before exploring the design intent of dynamic_cast, it is worth noting that many dynamic_cast implementations are quite slow.For example, there is at least one common implementation that is partially based on string comparisons of class names. If you execute dynamic_cast on an object in a f
In order to understand the operation principle of the COM library, this experiment was deliberately done:#include"stdafx.h"#include"objbase.h"#include"atlcomcli.h"#include"Limits"//#include "commctrl.h"#import"MSScript.ocx"No_namespaceextern "C"{typedef HRESULT (__stdcall *funcdllgetclassobject) (Refclsid rclsid,refiid riid,lpvoid *PPV);}structIScriptControl;int_tmain (intARGC, _tchar*argv[]) {Try{:: CoInitialize (NULL); Hmodule h=::loadlibrary ("MSSc
CreateInstance( IUnknown *pUnkOuter, const IID iid, void **ppv) = 0;5 6 virtual HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock) = 0;7 };
The class factory itself is actually a COM object, so the class factory will also inherit from iunknown. There is an interface function createinstance in the class factory. This createinstance is the function used by the COM library to create COM objects. Each class factory only targets specif
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.