Urlmon. dll has an API for download. The definition in msdn is as follows:
HRESULT URLDownloadToFile( LPUNKNOWN pCaller, LPCTSTR szURL, LPCTSTR szFileName, DWORD dwReserved, LPBINDSTATUSCALLBACK lpfnCB);
Delphi's urlmon. PAS has its Pascal statement:
function URLDownloadToFile( pCaller: IUnKnown, szURL: PAnsiChar, szFileName: PAnsiChar, dwReserved: DWORD, lpfnCB: IBindStatusCallBack;);
Using the IDWriteTextLayout. Draw () method to Draw text is mainly to implement the IDWriteTextRenderer interface.
The IDWriteTextRenderer interface can only be implemented manually and is flexible.
Unit Unit1; interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Direct2D, D2D1; type TForm1 = class (TForm) procedure FormPaint (Sender: TObject); procedure FormResize (Sender: TObject); end; iterator = class (TInterfacedObject, IDWriteTextRenderer) pri
icapturegraphbuilder2; it exposes methods to help build and control a capture graph.
First, create instances of igraphbuilder and icapturegraphbuilder2 by using the com function cocreateinstance:
Hresult = s_ OK;
Igraphbuilder * pfiltergraph;
Icapturegraphbuilder2 * pcapturegraphbuilder;
Hresult = cocreateinstance (clsid_filtergraph, null, clsctx_inproc,
Iid_igraphbuilder, (void **) pfiltergra
},Mailieband_tlb in 'mailieband _ TLB. pa ';
ExportsDllgetclassobject,Dllcanunloadnow,Dllregisterserver,Dllunregisterserver;
{$ R *. TLB}
{$ R *. Res}
BeginEnd.
Program list 1-7 bandunit. Pas
Unit bandunit;
Interface
UsesWindows, sysutils, messages, registry, shellapi, ActiveX, classes, comobj,Shlobj, dialogs, commctrl, shdocvw, ieform;
TypeTgetmailband = Class (tcomobject, ideskband, iobjectwithsite, ipersiststreaminit)PrivateFrmie: tform1;M_psite: iinputobjectsite;M_hwndparent: hwnd;M_hwnd: h
There are few examples of searching com aggregation on the Internet, either using ATL, simulating ATL, or simulating MFC. Most of them are based on principles. Since the process for querying the iunknown interface is different when you simulate MFC and when you actually use MFC, the method for simulating MFC is different from that for directly deriving from csf-target, there are major differences in the process. Even if you understand the principle of COM aggregation, you may not be able to dire
). After reading this article, you will be able to learn how to use the built-in components in the Windows operating system and the COM objects provided by third parties.This document assumes that you are proficient in the C ++ language. In the example code, we use a bit of MFC and ATL. If you are not familiar with MFC and ATL, this article will thoroughly explain these codes. This article includes the following parts:
Com -- what is it? -- Main Points of the COM standard, which is designed t
Urlopenstream is similar to urldownloadtofile, and is a com function for downloading files;
The former is downloaded to the istream stream, and the latter is directly downloaded to the specified path. It is not as convenient as the latter.
They are all declared in the urlmon unit. In this example, uses ActiveX is also required because the istream interface is used.
Function urlopenstream (P1: iunknown; {interface, don't use it, just give nil} P2: pwidechar; {path to download} P3: D
external object, the getexternal method mentioned above is called to query whether extended object is provided. The following is how to implement the getexternal method to implement extended external object. The Code is as follows:
Class mydochandler: Public idochostuihandler
{
Long refcount;
Public:
Mydochandler (): refcount (1 ){}
Virtual hresult stdmethodcalltype QueryInterface (refiid classid, void ** INTF ){
If (classid = iid_iunknown)
{
* INTF
passages can be viewed as files in the folder. If you insert a picture in your document, you can create a small folder in the folder-the Pictures folder-and add a shortcut to the content of each page in the location where you use the picture. The following illustration shows the concept of a previous description (note-I don't see the source code for Office, which is just one of my little guesses):
COM interface for structured storage files
Just finished the concept, in COM, the IStorage int
functions of CDB and cdbsrvfactory are changed into pure virtual functions. 2 Delete data members. 3 Delete all the member functions of the derivation of the flag. 4 Change the CDB to IDB (the interface of DB), Cdbsrvfactory to Idbsrvfactory (the interface of DB class factory)
typedef long HRESULT;#define Def_export __declspec (dllexport)Class IDB{InterfacesPublicInterface for data accessVirtual HRESULT R
by the client program. Including the following steps: 1 The functions of CDB and cdbsrvfactory are changed into pure virtual functions. 2 Delete data members. 3 Delete all the member functions of the derivation of the flag. 4 Convert CDB to IDB (interface for DB), Cdbsrvfactory to Idbsrvfactory (representing DB class factory interface) typedef long HRESULT;#define Def_export __declspec (dllexport)Class IDB{InterfacesPublic:Interface for data accessVi
The COM functions used by both methods are derived from the Urlmon, remember to refer to them first.First, UrldownloadtofileTo download files directly to disk, Urldownloadtofile declares as follows:function Urldownloadtofile (Caller:iunknown;Url:pwidechar; {Path to download}Filename:pwidechar; {The path saved to}Reserved:dword;Statuscb:ibindstatuscallback): HResult; stdcall;Urldownloadtofilea (Caller:iunknown; Url:pansichar; Filename:pansichar; Reserv
description of the security interface implemented by ATL.
For Activex written by MFC, you can modify the Registry to implement control security. Microsoft also provides a detailed document description. The specific implementation steps are as follows:
1. Add the cathelp. h and cathelp. cpp files to the project. The contents are as follows.
Cathelp. h
# include " comcat. h " // helper function to create a component category and associated // description
I read some of the blogs of cathyeagle.
Article Finally, I learned more about drag-and-drop action capturing. After some tossing, we can finally capture the drag-and-drop action of IE, which makes everything difficult at the beginning. Some interface declarations mentioned in catheagle are not found in Delphi. After searching, the interface declaration is as follows. For more information about drag and drop, see the series of articles in catheagle's Internet Explorer programming overview.
/
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.