jwaactivex.pas 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. {******************************************************************************}
  2. { }
  3. { Windows API interface Unit for Object Pascal }
  4. { Master file for Windows applications }
  5. { }
  6. { Portions created by Microsoft are Copyright (C) Microsoft Corporation. }
  7. { All Rights Reserved. }
  8. { }
  9. { The original Pascal code is: JwaActiveX.pas, released September 2005. }
  10. { The initial developer of the Pascal code is }
  11. { Robert Marquardt (robert_marquardt att gmx dott de). }
  12. { }
  13. { Portions created by Robert Marquardt are Copyright (C) 2005 }
  14. { Robert Marquardt. All Rights Reserved. }
  15. { }
  16. { Obtained through: Joint Endeavour of Delphi Innovators (Project JEDI) }
  17. { }
  18. { You may retrieve the latest version of this file at the Project JEDI }
  19. { APILIB home page, located at http://jedi-apilib.sourceforge.net }
  20. { }
  21. { The contents of this file are used with permission, subject to the Mozilla }
  22. { Public License Version 1.1 (the "License"); you may not use this file except }
  23. { in compliance with the License. You may obtain a copy of the License at }
  24. { http://www.mozilla.org/MPL/MPL-1.1.html }
  25. { }
  26. { Software distributed under the License is distributed on an "AS IS" basis, }
  27. { WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for }
  28. { the specific language governing rights and limitations under the License. }
  29. { }
  30. { Alternatively, the contents of this file may be used under the terms of the }
  31. { GNU Lesser General Public License (the "LGPL License"), in which case the }
  32. { provisions of the LGPL License are applicable instead of those above. }
  33. { If you wish to allow use of your version of this file only under the terms }
  34. { of the LGPL License and not to allow others to use your version of this file }
  35. { under the MPL, indicate your decision by deleting the provisions above and }
  36. { replace them with the notice and other provisions required by the LGPL }
  37. { License. If you do not delete the provisions above, a recipient may use }
  38. { your version of this file under either the MPL or the LGPL License. }
  39. { }
  40. { For more information about the LGPL: http://www.gnu.org/copyleft/lesser.html }
  41. { }
  42. {******************************************************************************}
  43. // $Id: JwaActiveX.pas,v 1.5 2007/10/18 16:32:37 dezipaitor Exp $
  44. {$IFNDEF JWA_OMIT_SECTIONS}
  45. unit JwaActiveX;
  46. {$WEAKPACKAGEUNIT}
  47. {$I jediapilib.inc}
  48. interface
  49. uses
  50. JwaWinType;
  51. {$ENDIF JWA_OMIT_SECTIONS}
  52. {$IFNDEF JWA_IMPLEMENTATIONSECTION}
  53. const
  54. { IConnectionPoint status codes }
  55. CONNECT_E_FIRST = HRESULT($80040200);
  56. {$EXTERNALSYM CONNECT_E_FIRST}
  57. CONNECT_E_LAST = HRESULT($8004020F);
  58. {$EXTERNALSYM CONNECT_E_LAST}
  59. CONNECT_S_FIRST = $00040200;
  60. {$EXTERNALSYM CONNECT_S_FIRST}
  61. CONNECT_S_LAST = $0004020F;
  62. {$EXTERNALSYM CONNECT_S_LAST}
  63. CONNECT_E_NOCONNECTION = CONNECT_E_FIRST + 0;
  64. {$EXTERNALSYM CONNECT_E_NOCONNECTION}
  65. CONNECT_E_ADVISELIMIT = CONNECT_E_FIRST + 1;
  66. {$EXTERNALSYM CONNECT_E_ADVISELIMIT}
  67. CONNECT_E_CANNOTCONNECT = CONNECT_E_FIRST + 2;
  68. {$EXTERNALSYM CONNECT_E_CANNOTCONNECT}
  69. CONNECT_E_OVERRIDDEN = CONNECT_E_FIRST + 3;
  70. {$EXTERNALSYM CONNECT_E_OVERRIDDEN}
  71. type
  72. IStream = interface;
  73. IMoniker = interface;
  74. IEnumMoniker = interface;
  75. IConnectionPointContainer = interface;
  76. IEnumSTATPROPSTG = interface;
  77. IEnumSTATPROPSETSTG = interface;
  78. TOleChar = WideChar;
  79. POleStr = PWideChar;
  80. PPOleStr = ^POleStr;
  81. PIID = PGUID;
  82. TIID = TGUID;
  83. PCLSID = PGUID;
  84. TCLSID = TGUID;
  85. Largeint = Int64;
  86. {$EXTERNALSYM Largeint}
  87. TClipFormat = Word;
  88. {$EXTERNALSYM TClipFormat}
  89. PClipFormat = ^TClipFormat;
  90. {$EXTERNALSYM PClipFormat}
  91. POleBool = ^TOleBool;
  92. TOleBool = WordBool;
  93. {$EXTERNALSYM TOleBool}
  94. POleDate = ^TOleDate;
  95. TOleDate = Double;
  96. {$EXTERNALSYM TOleDate}
  97. PBStr = ^TBStr;
  98. TBStr = POleStr;
  99. PSCODE = ^SCODE;
  100. {$EXTERNALSYM PSCODE}
  101. SCODE = Integer;
  102. {$EXTERNALSYM SCODE}
  103. PPropID = ^PROPID;
  104. PROPID = ULONG;
  105. {$EXTERNALSYM PROPID}
  106. TPropID = PROPID;
  107. PFmtID = ^FMTID;
  108. FMTID = TGUID;
  109. {$EXTERNALSYM FMTID}
  110. TFmtID = FMTID;
  111. PSafeArrayBound = ^SAFEARRAYBOUND;
  112. SAFEARRAYBOUND = record
  113. cElements: Longint;
  114. lLbound: Longint;
  115. end;
  116. TSafeArrayBound = SAFEARRAYBOUND;
  117. {$EXTERNALSYM SAFEARRAYBOUND}
  118. PSafeArray = ^SAFEARRAY;
  119. SAFEARRAY = record
  120. cDims: Word;
  121. fFeatures: Word;
  122. cbElements: Longint;
  123. cLocks: Longint;
  124. pvData: Pointer;
  125. rgsabound: array [0..0] of TSafeArrayBound;
  126. end;
  127. TSafeArray = SAFEARRAY;
  128. {$EXTERNALSYM SAFEARRAY}
  129. {$IFNDEF JWA_INCLUDEMODE}
  130. (* tagBLOB related types cause problem due to two definitions of BLOB in wtypes.h/nspapi.h *)
  131. (* Investigating something that will always work even when a BLOB is not a tagBLOB *)
  132. {$EXTERNALSYM PBlob}
  133. PBlob = ^TBlob;
  134. {$EXTERNALSYM tagBLOB}
  135. tagBLOB = record
  136. cbSize: Longint;
  137. pBlobData: Pointer;
  138. end;
  139. (* tagBLOB related types cause problem due to two definitions of BLOB in wtypes.h/nspapi.h *)
  140. (* Investigating something that will always work even when a BLOB is not a tagBLOB *)
  141. {$EXTERNALSYM TBlob}
  142. TBlob = tagBLOB;
  143. {$EXTERNALSYM BLOB}
  144. BLOB = TBlob;
  145. {$ENDIF JWA_INCLUDEMODE}
  146. PClipData = ^CLIPDATA;
  147. CLIPDATA = record
  148. cbSize: Longint;
  149. ulClipFmt: Longint;
  150. pClipData: Pointer;
  151. end;
  152. TClipData = CLIPDATA;
  153. {$EXTERNALSYM CLIPDATA}
  154. PDVTargetDevice = ^TDVTargetDevice;
  155. DVTARGETDEVICE = record
  156. tdSize: Longint;
  157. tdDriverNameOffset: Word;
  158. tdDeviceNameOffset: Word;
  159. tdPortNameOffset: Word;
  160. tdExtDevmodeOffset: Word;
  161. tdData: record end;
  162. end;
  163. {$EXTERNALSYM DVTARGETDEVICE}
  164. TDVTargetDevice = DVTARGETDEVICE;
  165. PFormatEtc = ^FORMATETC;
  166. FORMATETC = record
  167. cfFormat: TClipFormat;
  168. ptd: PDVTargetDevice;
  169. dwAspect: Longint;
  170. lindex: Longint;
  171. tymed: Longint;
  172. end;
  173. TFormatEtc = FORMATETC;
  174. {$EXTERNALSYM FORMATETC}
  175. PStgMedium = ^STGMEDIUM;
  176. STGMEDIUM = record
  177. tymed: Longint;
  178. case Integer of
  179. 0: (hBitmap: THandle; // HBITMAP
  180. unkForRelease: Pointer); // IUnknown
  181. 1: (hMetaFilePict: THandle);
  182. 2: (hEnhMetaFile: THandle);
  183. 3: (hGlobal: HGLOBAL);
  184. 4: (lpszFileName: POleStr);
  185. 5: (stm: Pointer); // IStream
  186. 6: (stg: Pointer); // IStorage
  187. end;
  188. TStgMedium = STGMEDIUM;
  189. {$EXTERNALSYM STGMEDIUM}
  190. IEnumVariant = interface(IUnknown)
  191. ['{00020404-0000-0000-C000-000000000046}']
  192. function Next(celt: Longword; var rgvar: OleVariant;
  193. out pceltFetched: Longword): HRESULT; stdcall;
  194. function Skip(celt: Longword): HRESULT; stdcall;
  195. function Reset: HRESULT; stdcall;
  196. function Clone(out Enum: IEnumVariant): HRESULT; stdcall;
  197. end;
  198. {$EXTERNALSYM IEnumVariant}
  199. IPersist = interface(IUnknown)
  200. ['{0000010C-0000-0000-C000-000000000046}']
  201. function GetClassID(out classID: TCLSID): HRESULT; stdcall;
  202. end;
  203. {$EXTERNALSYM IPersist}
  204. IEnumFORMATETC = interface(IUnknown)
  205. ['{00000103-0000-0000-C000-000000000046}']
  206. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  207. function Skip(celt: Longint): HRESULT; stdcall;
  208. function Reset: HRESULT; stdcall;
  209. function Clone(out Enum: IEnumFormatEtc): HRESULT; stdcall;
  210. end;
  211. {$EXTERNALSYM IEnumFORMATETC}
  212. IPersistStream = interface(IPersist)
  213. ['{00000109-0000-0000-C000-000000000046}']
  214. function IsDirty: HRESULT; stdcall;
  215. function Load(const stm: IStream): HRESULT; stdcall;
  216. function Save(const stm: IStream; fClearDirty: BOOL): HRESULT; stdcall;
  217. function GetSizeMax(out cbSize: Largeint): HRESULT; stdcall;
  218. end;
  219. {$EXTERNALSYM IPersistStream}
  220. PStatStg = ^TStatStg;
  221. STATSTG = record
  222. pwcsName: POleStr;
  223. dwType: Longint;
  224. cbSize: Largeint;
  225. mtime: TFileTime;
  226. ctime: TFileTime;
  227. atime: TFileTime;
  228. grfMode: Longint;
  229. grfLocksSupported: Longint;
  230. clsid: TCLSID;
  231. grfStateBits: Longint;
  232. reserved: Longint;
  233. end;
  234. TStatStg = STATSTG;
  235. {$EXTERNALSYM STATSTG}
  236. {$EXTERNALSYM ISequentialStream}
  237. ISequentialStream = interface(IUnknown)
  238. ['{0c733a30-2a1c-11ce-ade5-00aa0044773d}']
  239. function Read(pv: Pointer; cb: Longint; pcbRead: PLongint): HRESULT; stdcall;
  240. function Write(pv: Pointer; cb: Longint; pcbWritten: PLongint): HRESULT; stdcall;
  241. end;
  242. IStream = interface(ISequentialStream)
  243. ['{0000000C-0000-0000-C000-000000000046}']
  244. function Seek(dlibMove: Largeint; dwOrigin: Longint;
  245. out libNewPosition: Largeint): HRESULT; stdcall;
  246. function SetSize(libNewSize: Largeint): HRESULT; stdcall;
  247. function CopyTo(stm: IStream; cb: Largeint; out cbRead: Largeint;
  248. out cbWritten: Largeint): HRESULT; stdcall;
  249. function Commit(grfCommitFlags: Longint): HRESULT; stdcall;
  250. function Revert: HRESULT; stdcall;
  251. function LockRegion(libOffset: Largeint; cb: Largeint;
  252. dwLockType: Longint): HRESULT; stdcall;
  253. function UnlockRegion(libOffset: Largeint; cb: Largeint;
  254. dwLockType: Longint): HRESULT; stdcall;
  255. function Stat(out statstg: TStatStg; grfStatFlag: Longint): HRESULT; stdcall;
  256. function Clone(out stm: IStream): HRESULT; stdcall;
  257. end;
  258. {$EXTERNALSYM IStream}
  259. IEnumString = interface(IUnknown)
  260. ['{00000101-0000-0000-C000-000000000046}']
  261. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  262. function Skip(celt: Longint): HRESULT; stdcall;
  263. function Reset: HRESULT; stdcall;
  264. function Clone(out enm: IEnumString): HRESULT; stdcall;
  265. end;
  266. {$EXTERNALSYM IEnumString}
  267. IRunningObjectTable = interface(IUnknown)
  268. ['{00000010-0000-0000-C000-000000000046}']
  269. function Register(grfFlags: Longint; const unkObject: IUnknown;
  270. const mkObjectName: IMoniker; out dwRegister: Longint): HRESULT; stdcall;
  271. function Revoke(dwRegister: Longint): HRESULT; stdcall;
  272. function IsRunning(const mkObjectName: IMoniker): HRESULT; stdcall;
  273. function GetObject(const mkObjectName: IMoniker;
  274. out unkObject: IUnknown): HRESULT; stdcall;
  275. function NoteChangeTime(dwRegister: Longint; const filetime: TFileTime): HRESULT; stdcall;
  276. function GetTimeOfLastChange(const mkObjectName: IMoniker;
  277. out filetime: TFileTime): HRESULT; stdcall;
  278. function EnumRunning(out enumMoniker: IEnumMoniker): HRESULT; stdcall;
  279. end;
  280. {$EXTERNALSYM IRunningObjectTable}
  281. PBindOpts = ^TBindOpts;
  282. BIND_OPTS = record
  283. cbStruct: Longint;
  284. grfFlags: Longint;
  285. grfMode: Longint;
  286. dwTickCountDeadline: Longint;
  287. end;
  288. TBindOpts = BIND_OPTS;
  289. {$EXTERNALSYM BIND_OPTS}
  290. IBindCtx = interface(IUnknown)
  291. ['{0000000E-0000-0000-C000-000000000046}']
  292. function RegisterObjectBound(const unk: IUnknown): HRESULT; stdcall;
  293. function RevokeObjectBound(const unk: IUnknown): HRESULT; stdcall;
  294. function ReleaseBoundObjects: HRESULT; stdcall;
  295. function SetBindOptions(const bindopts: TBindOpts): HRESULT; stdcall;
  296. function GetBindOptions(var bindopts: TBindOpts): HRESULT; stdcall;
  297. function GetRunningObjectTable(out rot: IRunningObjectTable): HRESULT; stdcall;
  298. function RegisterObjectParam(pszKey: POleStr; const unk: IUnknown): HRESULT; stdcall;
  299. function GetObjectParam(pszKey: POleStr; out unk: IUnknown): HRESULT; stdcall;
  300. function EnumObjectParam(out Enum: IEnumString): HRESULT; stdcall;
  301. function RevokeObjectParam(pszKey: POleStr): HRESULT; stdcall;
  302. end;
  303. {$EXTERNALSYM IBindCtx}
  304. PIMoniker = ^IMoniker;
  305. {$EXTERNALSYM PIMoniker}
  306. IMoniker = interface(IPersistStream)
  307. ['{0000000F-0000-0000-C000-000000000046}']
  308. function BindToObject(const bc: IBindCtx; const mkToLeft: IMoniker;
  309. const iidResult: TIID; out vResult): HRESULT; stdcall;
  310. function BindToStorage(const bc: IBindCtx; const mkToLeft: IMoniker;
  311. const iid: TIID; out vObj): HRESULT; stdcall;
  312. function Reduce(const bc: IBindCtx; dwReduceHowFar: Longint;
  313. mkToLeft: PIMoniker; out mkReduced: IMoniker): HRESULT; stdcall;
  314. function ComposeWith(const mkRight: IMoniker; fOnlyIfNotGeneric: BOOL;
  315. out mkComposite: IMoniker): HRESULT; stdcall;
  316. function Enum(fForward: BOOL; out enumMoniker: IEnumMoniker): HRESULT; stdcall;
  317. function IsEqual(const mkOtherMoniker: IMoniker): HRESULT; stdcall;
  318. function Hash(out dwHash: Longint): HRESULT; stdcall;
  319. function IsRunning(const bc: IBindCtx; const mkToLeft: IMoniker;
  320. const mkNewlyRunning: IMoniker): HRESULT; stdcall;
  321. function GetTimeOfLastChange(const bc: IBindCtx; const mkToLeft: IMoniker;
  322. out filetime: TFileTime): HRESULT; stdcall;
  323. function Inverse(out mk: IMoniker): HRESULT; stdcall;
  324. function CommonPrefixWith(const mkOther: IMoniker;
  325. out mkPrefix: IMoniker): HRESULT; stdcall;
  326. function RelativePathTo(const mkOther: IMoniker;
  327. out mkRelPath: IMoniker): HRESULT; stdcall;
  328. function GetDisplayName(const bc: IBindCtx; const mkToLeft: IMoniker;
  329. out pszDisplayName: POleStr): HRESULT; stdcall;
  330. function ParseDisplayName(const bc: IBindCtx; const mkToLeft: IMoniker;
  331. pszDisplayName: POleStr; out chEaten: Longint;
  332. out mkOut: IMoniker): HRESULT; stdcall;
  333. function IsSystemMoniker(out dwMksys: Longint): HRESULT; stdcall;
  334. end;
  335. {$EXTERNALSYM IMoniker}
  336. {$EXTERNALSYM IEnumMoniker}
  337. IEnumMoniker = interface(IUnknown)
  338. ['{00000102-0000-0000-C000-000000000046}']
  339. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  340. function Skip(celt: Longint): HRESULT; stdcall;
  341. function Reset: HRESULT; stdcall;
  342. function Clone(out enm: IEnumMoniker): HRESULT; stdcall;
  343. end;
  344. IAdviseSink = interface(IUnknown)
  345. ['{0000010F-0000-0000-C000-000000000046}']
  346. procedure OnDataChange(const formatetc: TFormatEtc; const stgmed: TStgMedium); stdcall;
  347. procedure OnViewChange(dwAspect: Longint; lindex: Longint); stdcall;
  348. procedure OnRename(const mk: IMoniker); stdcall;
  349. procedure OnSave; stdcall;
  350. procedure OnClose; stdcall;
  351. end;
  352. {$EXTERNALSYM IAdviseSink}
  353. PStatData = ^TStatData;
  354. STATDATA = record
  355. formatetc: TFormatEtc;
  356. advf: Longint;
  357. advSink: IAdviseSink;
  358. dwConnection: Longint;
  359. end;
  360. TStatData = STATDATA;
  361. {$EXTERNALSYM STATDATA}
  362. IEnumSTATDATA = interface(IUnknown)
  363. ['{00000105-0000-0000-C000-000000000046}']
  364. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  365. function Skip(celt: Longint): HRESULT; stdcall;
  366. function Reset: HRESULT; stdcall;
  367. function Clone(out Enum: IEnumSTATDATA): HRESULT; stdcall;
  368. end;
  369. {$EXTERNALSYM IEnumSTATDATA}
  370. IDataObject = interface(IUnknown)
  371. ['{0000010E-0000-0000-C000-000000000046}']
  372. function GetData(const formatetcIn: TFormatEtc; out medium: TStgMedium): HRESULT; stdcall;
  373. function GetDataHere(const formatetc: TFormatEtc; out medium: TStgMedium): HRESULT; stdcall;
  374. function QueryGetData(const formatetc: TFormatEtc): HRESULT; stdcall;
  375. function GetCanonicalFormatEtc(const formatetc: TFormatEtc; out formatetcOut: TFormatEtc): HRESULT; stdcall;
  376. function SetData(const formatetc: TFormatEtc; var medium: TStgMedium; fRelease: BOOL): HRESULT; stdcall;
  377. function EnumFormatEtc(dwDirection: DWORD; out enumFormatEtc: IEnumFORMATETC): HRESULT; stdcall;
  378. function DAdvise(const formatetc: TFormatEtc; advf: DWORD;
  379. const advSink: IAdviseSink; out dwConnection: DWORD): HRESULT; stdcall;
  380. function DUnadvise(dwConnection: DWORD): HRESULT; stdcall;
  381. function EnumDAdvise(out enumAdvise: IEnumSTATDATA): HRESULT; stdcall;
  382. end;
  383. {$EXTERNALSYM IDataObject}
  384. IEnumConnectionPoints = interface
  385. ['{B196B285-BAB4-101A-B69C-00AA00341D07}']
  386. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  387. function Skip(celt: Longint): HRESULT; stdcall;
  388. function Reset: HRESULT; stdcall;
  389. function Clone(out Enum: IEnumConnectionPoints): HRESULT; stdcall;
  390. end;
  391. {$EXTERNALSYM IEnumConnectionPoints}
  392. IEnumConnections = interface
  393. ['{B196B287-BAB4-101A-B69C-00AA00341D07}']
  394. function Next(celt: Longint; out elt; pceltFetched: PLongint): HRESULT; stdcall;
  395. function Skip(celt: Longint): HRESULT; stdcall;
  396. function Reset: HRESULT; stdcall;
  397. function Clone(out Enum: IEnumConnections): HRESULT; stdcall;
  398. end;
  399. {$EXTERNALSYM IEnumConnections}
  400. IConnectionPoint = interface
  401. ['{B196B286-BAB4-101A-B69C-00AA00341D07}']
  402. function GetConnectionInterface(out iid: TIID): HRESULT; stdcall;
  403. function GetConnectionPointContainer(out cpc: IConnectionPointContainer): HRESULT; stdcall;
  404. function Advise(const unkSink: IUnknown; out dwCookie: Longint): HRESULT; stdcall;
  405. function Unadvise(dwCookie: Longint): HRESULT; stdcall;
  406. function EnumConnections(out Enum: IEnumConnections): HRESULT; stdcall;
  407. end;
  408. {$EXTERNALSYM IConnectionPoint}
  409. IConnectionPointContainer = interface
  410. ['{B196B284-BAB4-101A-B69C-00AA00341D07}']
  411. function EnumConnectionPoints(out Enum: IEnumConnectionPoints): HRESULT; stdcall;
  412. function FindConnectionPoint(const iid: TIID; out cp: IConnectionPoint): HRESULT; stdcall;
  413. end;
  414. {$EXTERNALSYM IConnectionPointContainer}
  415. PPropVariant = ^TPropVariant;
  416. CAUB = packed record
  417. cElems: ULONG;
  418. pElems: PByte;
  419. end;
  420. {$EXTERNALSYM CAUB}
  421. PCAUB = ^TCAUB;
  422. TCAUB = CAUB;
  423. CAI = packed record
  424. cElems: ULONG;
  425. pElems: PShortInt;
  426. end;
  427. {$EXTERNALSYM CAI}
  428. PCAI = ^TCAI;
  429. TCAI = CAI;
  430. CAUI = packed record
  431. cElems: ULONG;
  432. pElems: PWord;
  433. end;
  434. {$EXTERNALSYM CAUI}
  435. PCAUI = ^TCAUI;
  436. TCAUI = CAUI;
  437. CAL = packed record
  438. cElems: ULONG;
  439. pElems: PLongint;
  440. end;
  441. {$EXTERNALSYM CAL}
  442. PCAL = ^TCAL;
  443. TCAL = CAL;
  444. CAUL = packed record
  445. cElems: ULONG;
  446. pElems: PULONG;
  447. end;
  448. {$EXTERNALSYM CAUL}
  449. PCAUL = ^TCAUL;
  450. TCAUL = CAUL;
  451. CAFLT = packed record
  452. cElems: ULONG;
  453. pElems: PSingle;
  454. end;
  455. {$EXTERNALSYM CAFLT}
  456. PCAFLT = ^TCAFLT;
  457. TCAFLT = CAFLT;
  458. CADBL = packed record
  459. cElems: ULONG;
  460. pElems: PDouble;
  461. end;
  462. {$EXTERNALSYM CADBL}
  463. PCADBL = ^TCADBL;
  464. TCADBL = CADBL;
  465. CACY = packed record
  466. cElems: ULONG;
  467. pElems: PCurrency;
  468. end;
  469. {$EXTERNALSYM CACY}
  470. PCACY = ^TCACY;
  471. TCACY = CACY;
  472. CADATE = packed record
  473. cElems: ULONG;
  474. pElems: POleDate;
  475. end;
  476. {$EXTERNALSYM CADATE}
  477. PCADATE = ^TCADATE;
  478. TCADATE = CADATE;
  479. CABSTR = packed record
  480. cElems: ULONG;
  481. pElems: PBSTR;
  482. end;
  483. {$EXTERNALSYM CABSTR}
  484. PCABSTR = ^TCABSTR;
  485. TCABSTR = CABSTR;
  486. CABOOL = packed record
  487. cElems: ULONG;
  488. pElems: POleBool;
  489. end;
  490. {$EXTERNALSYM CABOOL}
  491. PCABOOL = ^TCABOOL;
  492. TCABOOL = CABOOL;
  493. CASCODE = packed record
  494. cElems: ULONG;
  495. pElems: PSCODE;
  496. end;
  497. {$EXTERNALSYM CASCODE}
  498. PCASCODE = ^TCASCODE;
  499. TCASCODE = CASCODE;
  500. CAPROPVARIANT = packed record
  501. cElems: ULONG;
  502. pElems: PPropVariant;
  503. end;
  504. {$EXTERNALSYM CAPROPVARIANT}
  505. PCAPROPVARIANT = ^TCAPROPVARIANT;
  506. TCAPROPVARIANT = CAPROPVARIANT;
  507. CAH = packed record
  508. cElems: ULONG;
  509. pElems: PLargeInteger;
  510. end;
  511. {$EXTERNALSYM CAH}
  512. PCAH = ^TCAH;
  513. TCAH = CAH;
  514. CAUH = packed record
  515. cElems: ULONG;
  516. pElems: PULargeInteger;
  517. end;
  518. {$EXTERNALSYM CAUH}
  519. PCAUH = ^TCAUH;
  520. TCAUH = CAUH;
  521. CALPSTR = packed record
  522. cElems: ULONG;
  523. pElems: PLPSTR;
  524. end;
  525. {$EXTERNALSYM CALPSTR}
  526. PCALPSTR = ^TCALPSTR;
  527. TCALPSTR = CALPSTR;
  528. CALPWSTR = packed record
  529. cElems: ULONG;
  530. pElems: PLPWSTR;
  531. end;
  532. {$EXTERNALSYM CALPWSTR}
  533. PCALPWSTR = ^TCALPWSTR;
  534. TCALPWSTR = CALPWSTR;
  535. CAFILETIME = packed record
  536. cElems: ULONG;
  537. pElems: PFileTime;
  538. end;
  539. {$EXTERNALSYM CAFILETIME}
  540. PCAFILETIME = ^TCAFILETIME;
  541. TCAFILETIME = CAFILETIME;
  542. CACLIPDATA = packed record
  543. cElems: ULONG;
  544. pElems: PClipData;
  545. end;
  546. {$EXTERNALSYM CACLIPDATA}
  547. PCACLIPDATA = ^TCACLIPDATA;
  548. TCACLIPDATA = CACLIPDATA;
  549. CACLSID = packed record
  550. cElems: ULONG;
  551. pElems: PCLSID;
  552. end;
  553. {$EXTERNALSYM CACLSID}
  554. PCACLSID = ^TCACLSID;
  555. TCACLSID = CACLSID;
  556. PROPVARIANT = packed record
  557. vt: TVarType;
  558. wReserved1: Word;
  559. wReserved2: Word;
  560. wReserved3: Word;
  561. case Integer of
  562. 0: (bVal: Byte);
  563. 1: (iVal: Smallint);
  564. 2: (uiVal: Word);
  565. 3: (boolVal: TOleBool);
  566. 4: (bool: TOleBool);
  567. 5: (lVal: Longint);
  568. 6: (ulVal: Cardinal);
  569. 7: (fltVal: Single);
  570. 8: (scode: SCODE);
  571. 9: (hVal: LARGE_INTEGER);
  572. 10: (uhVal: ULARGE_INTEGER);
  573. 11: (dblVal: Double);
  574. 12: (cyVal: Currency);
  575. 13: (date: TOleDate);
  576. 14: (filetime: TFileTime);
  577. 15: (puuid: PGUID);
  578. 16: (blob: TBlob);
  579. 17: (pclipdata: PClipData);
  580. 18: (pStream: Pointer); // IStream
  581. 19: (pStorage: Pointer); // IStorage
  582. 20: (bstrVal: TBStr);
  583. 21: (pszVal: PAnsiChar);
  584. 22: (pwszVal: PWideChar);
  585. 23: (caub: TCAUB);
  586. 24: (cai: TCAI);
  587. 25: (caui: TCAUI);
  588. 26: (cabool: TCABOOL);
  589. 27: (cal: TCAL);
  590. 28: (caul: TCAUL);
  591. 29: (caflt: TCAFLT);
  592. 30: (cascode: TCASCODE);
  593. 31: (cah: TCAH);
  594. 32: (cauh: TCAUH);
  595. 33: (cadbl: TCADBL);
  596. 34: (cacy: TCACY);
  597. 35: (cadate: TCADATE);
  598. 36: (cafiletime: TCAFILETIME);
  599. 37: (cauuid: TCACLSID);
  600. 38: (caclipdata: TCACLIPDATA);
  601. 39: (cabstr: TCABSTR);
  602. 40: (calpstr: TCALPSTR);
  603. 41: (calpwstr: TCALPWSTR );
  604. 42: (capropvar: TCAPROPVARIANT);
  605. end;
  606. {$EXTERNALSYM PROPVARIANT}
  607. TPropVariant = PROPVARIANT;
  608. PROPSPEC = packed record
  609. ulKind: ULONG;
  610. case Integer of
  611. 0: (propid: TPropID);
  612. 1: (lpwstr: POleStr);
  613. end;
  614. {$EXTERNALSYM PROPSPEC}
  615. PPropSpec = ^TPropSpec;
  616. TPropSpec = PROPSPEC;
  617. STATPROPSTG = record
  618. lpwstrName: POleStr;
  619. propid: TPropID;
  620. vt: TVarType;
  621. end;
  622. {$EXTERNALSYM STATPROPSTG}
  623. PStatPropStg = ^TStatPropStg;
  624. TStatPropStg = STATPROPSTG;
  625. STATPROPSETSTG = packed record
  626. fmtid: TFmtID;
  627. clsid: TClsID;
  628. grfFlags: DWORD;
  629. mtime: TFileTime;
  630. ctime: TFileTime;
  631. atime: TFileTime;
  632. dwOSVersion: DWORD;
  633. end;
  634. {$EXTERNALSYM STATPROPSETSTG}
  635. PStatPropSetStg = ^TStatPropSetStg;
  636. TStatPropSetStg = STATPROPSETSTG;
  637. IPropertyStorage = interface(IUnknown)
  638. ['{00000138-0000-0000-C000-000000000046}']
  639. function ReadMultiple(cpspec: ULONG; rgpspec : PPropSpec; rgpropvar: PPropVariant): HRESULT; stdcall;
  640. function WriteMultiple(cpspec: ULONG; rgpspec : PPropSpec; rgpropvar: PPropVariant;
  641. propidNameFirst: TPropID): HRESULT; stdcall;
  642. function DeleteMultiple(cpspec: ULONG; rgpspec: PPropSpec): HRESULT; stdcall;
  643. function ReadPropertyNames(cpropid: ULONG; rgpropid: PPropID;
  644. rglpwstrName: PPOleStr): HRESULT; stdcall;
  645. function WritePropertyNames(cpropid: ULONG; rgpropid: PPropID;
  646. rglpwstrName: PPOleStr): HRESULT; stdcall;
  647. function DeletePropertyNames(cpropid: ULONG; rgpropid: PPropID): HRESULT; stdcall;
  648. function Commit(grfCommitFlags: DWORD): HRESULT; stdcall;
  649. function Revert: HRESULT; stdcall;
  650. function Enum(out ppenum: IEnumSTATPROPSTG): HRESULT; stdcall;
  651. function SetTimes(const pctime, patime, pmtime: TFileTime): HRESULT; stdcall;
  652. function SetClass(const clsid: TCLSID): HRESULT; stdcall;
  653. function Stat(pstatpsstg: PStatPropSetStg): HRESULT; stdcall;
  654. end;
  655. {$EXTERNALSYM IPropertyStorage}
  656. IPropertySetStorage = interface(IUnknown)
  657. ['{0000013A-0000-0000-C000-000000000046}']
  658. function Create(const rfmtid: TFmtID; const pclsid: TCLSID; grfFlags,
  659. grfMode: DWORD; out ppprstg: IPropertyStorage): HRESULT; stdcall;
  660. function Open(const rfmtid: TFmtID; grfMode: DWORD;
  661. out ppprstg: IPropertyStorage): HRESULT; stdcall;
  662. function Delete(const rfmtid: TFmtID): HRESULT; stdcall;
  663. function Enum(out ppenum: IEnumSTATPROPSETSTG): HRESULT; stdcall;
  664. end;
  665. {$EXTERNALSYM IPropertySetStorage}
  666. IEnumSTATPROPSTG = interface(IUnknown)
  667. ['{00000139-0000-0000-C000-000000000046}']
  668. function Next(celt: ULONG; out rgelt; pceltFetched: PULONG): HRESULT; stdcall;
  669. function Skip(celt: ULONG): HRESULT; stdcall;
  670. function Reset: HRESULT; stdcall;
  671. function Clone(out ppenum: IEnumSTATPROPSTG): HRESULT; stdcall;
  672. end;
  673. {$EXTERNALSYM IEnumSTATPROPSTG}
  674. IEnumSTATPROPSETSTG = interface(IUnknown)
  675. ['{0000013B-0000-0000-C000-000000000046}']
  676. function Next(celt: ULONG; out rgelt; pceltFetched: PULONG): HRESULT; stdcall;
  677. function Skip(celt: ULONG): HRESULT; stdcall;
  678. function Reset: HRESULT; stdcall;
  679. function Clone(out ppenum: IEnumSTATPROPSETSTG): HRESULT; stdcall;
  680. end;
  681. {$EXTERNALSYM IEnumSTATPROPSETSTG}
  682. IEnumStatStg = interface(IUnknown)
  683. ['{0000000D-0000-0000-C000-000000000046}']
  684. function Next(celt: Longint; out elt;
  685. pceltFetched: PLongint): HResult; stdcall;
  686. function Skip(celt: Longint): HResult; stdcall;
  687. function Reset: HResult; stdcall;
  688. function Clone(out enm: IEnumStatStg): HResult; stdcall;
  689. end;
  690. {$EXTERNALSYM IEnumStatStg}
  691. TSNB = ^POleStr;
  692. IStorage = interface(IUnknown)
  693. ['{0000000B-0000-0000-C000-000000000046}']
  694. function CreateStream(pwcsName: POleStr; grfMode: Longint; reserved1: Longint;
  695. reserved2: Longint; out stm: IStream): HRESULT; stdcall;
  696. function OpenStream(pwcsName: POleStr; reserved1: Pointer; grfMode: Longint;
  697. reserved2: Longint; out stm: IStream): HRESULT; stdcall;
  698. function CreateStorage(pwcsName: POleStr; grfMode: Longint;
  699. dwStgFmt: Longint; reserved2: Longint; out stg: IStorage): HRESULT; stdcall;
  700. function OpenStorage(pwcsName: POleStr; const stgPriority: IStorage;
  701. grfMode: Longint; snbExclude: TSNB; reserved: Longint; out stg: IStorage): HRESULT; stdcall;
  702. function CopyTo(ciidExclude: Longint; rgiidExclude: PIID;
  703. snbExclude: TSNB; const stgDest: IStorage): HRESULT; stdcall;
  704. function MoveElementTo(pwcsName: POleStr; const stgDest: IStorage;
  705. pwcsNewName: POleStr; grfFlags: Longint): HRESULT; stdcall;
  706. function Commit(grfCommitFlags: Longint): HRESULT; stdcall;
  707. function Revert: HRESULT; stdcall;
  708. function EnumElements(reserved1: Longint; reserved2: Pointer; reserved3: Longint;
  709. out enm: IEnumStatStg): HRESULT; stdcall;
  710. function DestroyElement(pwcsName: POleStr): HRESULT; stdcall;
  711. function RenameElement(pwcsOldName: POleStr; pwcsNewName: POleStr): HRESULT; stdcall;
  712. function SetElementTimes(pwcsName: POleStr; const ctime: TFileTime;
  713. const atime: TFileTime; const mtime: TFileTime): HRESULT; stdcall;
  714. function SetClass(const clsid: TCLSID): HRESULT; stdcall;
  715. function SetStateBits(grfStateBits: Longint; grfMask: Longint): HRESULT; stdcall;
  716. function Stat(out statstg: TStatStg; grfStatFlag: Longint): HRESULT; stdcall;
  717. end;
  718. {$EXTERNALSYM IStorage}
  719. {$ENDIF JWA_IMPLEMENTATIONSECTION}
  720. {$IFNDEF JWA_OMIT_SECTIONS}
  721. implementation
  722. //uses ...
  723. {$ENDIF JWA_OMIT_SECTIONS}
  724. {$IFNDEF JWA_INTERFACESECTION}
  725. //your implementation here
  726. {$ENDIF JWA_INTERFACESECTION}
  727. {$IFNDEF JWA_OMIT_SECTIONS}
  728. end.
  729. {$ENDIF JWA_OMIT_SECTIONS}