Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 Mar : Header Translation: Windows PropSys API

www.cryer.info
Managed Newsgroup Archive

Header Translation: Windows PropSys API

Subject:Header Translation: Windows PropSys API
Posted by:"Andrew Fiddian-Green" (..@dd)
Date:Sun, 30 Mar 2008 19:11:15

Hi,

I was unable to find any header translations for the Interfaces declared
in the Windows PropSys API so I made an attempt at translating (some of)
the source code from PropSys.idl from the Windows SDK into Pascal (below).

This is more or less the first time I did such a thing, so would
appreciate if somebody would be willing to cross check it for me.

Regards,
AndrewFG

++++

From PropSys.idl
================

[
     uuid(b7d14566-0509-4cce-a71f-0a554233bd9b),
     object,
     pointer_default(unique)
]
interface IInitializeWithFile : IUnknown
{
     HRESULT Initialize(
         [in, string] LPCWSTR pszFilePath,
         [in] DWORD grfMode);
}

[
     uuid(b824b49d-22ac-4161-ac8a-9916e8fa3f7f),
     object,
     pointer_default(unique)
]
interface IInitializeWithStream : IUnknown
{
     [local] HRESULT Initialize(
         [in] IStream *pstream,
         [in] DWORD grfMode);

     [call_as(Initialize)] HRESULT RemoteInitialize(
         [in] IStream *pstream,
         [in] DWORD grfMode);
}

[
     uuid(886d8eeb-8cf2-4446-8d02-cdba1dbdcf99),
     helpstring("Simple Property Store Interface"),
     object,
     pointer_default(unique)
]
interface IPropertyStore : IUnknown
{
     HRESULT GetCount(
         [out] DWORD *cProps);

     HRESULT GetAt(
         [in] DWORD iProp,
         [out] PROPERTYKEY *pkey);

     HRESULT GetValue(
         [in] REFPROPERTYKEY key,
         [out] PROPVARIANT *pv);

     HRESULT SetValue(
         [in] REFPROPERTYKEY key,
         [in] REFPROPVARIANT propvar);

     HRESULT Commit();
}

[
     uuid(c8e2d566-186e-4d49-bf41-6909ead56acc),
     object,
     pointer_default(unique)
]
interface IPropertyStoreCapabilities : IUnknown
{
     HRESULT IsPropertyWritable([in] REFPROPERTYKEY key);
}
</PropSys.idl>


Delphi Translation
==================

   IInitializeWithFile = interface(IUnknown)
   ['{b7d14566-0509-4cce-a71f-0a554233bd9b}']
     function Initialize(pszFilePath: PAnsiChar; grfMode: DWORD):
HRESULT; stdcall;
   end;

   IInitializeWithStream = interface(IUnknown)
   ['{b824b49d-22ac-4161-ac8a-9916e8fa3f7f}']
     function Initialize(var pIStream: IStream; grfMode: DWORD):
HRESULT; stdcall;
   end;

   IPropertyStore = interface(IUnknown)
   ['{886d8eeb-8cf2-4446-8d02-cdba1dbdcf99}']
     function GetCount(out cProps: DWORD): HRESULT; stdcall;
     function GetAt(iProp: DWORD; out PropKey: TPropertyKey): HRESULT;
stdcall;
     function GetValue(pPropKey: PPropertyKey; out PropVar:
TPropVariant): HRESULT; stdcall;
     function SetValue(pPropKey: PPropertyKey; pPropVar: PPropVariant):
HRESULT; stdcall;
     function Commit: HRESULT; stdcall;
   end;

   IPropertyStoreCapabilities = interface(IUnknown)
   ['{c8e2d566-186e-4d49-bf41-6909ead56acc}']
     function IsPropertyWritable(pPropKey: PPropertyKey): HRESULT; stdcall;
   end;

Replies:

www.cryer.info
Managed Newsgroup Archive