Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#1

C++ Delphi Übersetzung 3DYDYoutube Filter

  Alt 2. Okt 2018, 22:27
Ich baue gerade den Filter für YouTube in meine Library ein.
Und muss das übersetzen.

Code:
interface __declspec(uuid("FF762ACC-13EC-463A-A29C-FD4B0CD3E019"))
ISupportedSites: public IUnknown {
  enum { kVersion = 5 };

  // Version number equals to total number of functions within the interface
  // (ISupportedSites::kVersion is the current version). New functions are
  // appended to the interface. Function signatures are never change. Therefore
  // version number is the way to check whether particular function is available
  // in the interface
  STDMETHOD_(UINT, GetVersion)() = 0;

  // Number of supported sites
  STDMETHOD_(UINT, GetCount)() = 0;

  // Get site name or NULL if index >= GetCount()
  STDMETHOD_(BSTR, GetName)(UINT index) = 0;

  // Test whether url can be analyzed for video retrieving. S_FALSE means that
  // url seems from the supported site but not a valid video clip page. When
  // S_OK is returned, canonical_url will contain canonical page url, otherwise
  // it will not be changed
  // If explicitly == TRUE then S_OK will be returned only if URL definitely
  // points to video page URL instead of maybe just to some other page from the
  // supported site. This can be determined only for few sites, for others need
  // page data to determine this
  STDMETHOD(Test)(__in LPCWSTR url, __in BOOL explicitly, __out_opt BSTR* canonical_url) = 0;

  // Returns clip start time encoded in URL, in milliseconds
  STDMETHOD_(UINT, GetStartTime)(LPCWSTR url) = 0;
};
Delphi-Quellcode:
  ISupportedSites = interface(IUnknown)
    ['{FF762ACC-13EC-463A-A29C-FD4B0CD3E019}']
    (* ** ISupportedSites methods ** *)
    function GetVersion: UINT; stdcall;
    function GetCount: UINT; stdcall;
    function GetName(index: UINT): string; stdcall;
    function Test(url: PWideChar; explicitly: BOOL; out canonical_url: string): HRESULT; stdcall;
    function GetStartTime(url: PWideChar): UINT; stdcall;
  end;
Sollte eigentlich in Ordnung sein.
Wenn nicht bitte mitteilen was nicht stimmt.

Frage mich nur wie soll ich das Enum dazwischen klatschen. (Das ist meine Frage)

Code:
  enum { kVersion = 5 };
Die Infos sind recht spärlich und Antwort von ihm habe ich leider auch keine bekommen.

gruss

Geändert von EWeiss ( 3. Okt 2018 um 17:58 Uhr)
  Mit Zitat antworten Zitat