Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   IExtractImage (https://www.delphipraxis.net/207443-iextractimage.html)

tomkupitz 24. Mär 2021 15:54

IExtractImage
 
Hallo,

ich habe einen gültigen ShellFolder und einen gültigen RelativePIDL. Das ExtractImage ist gültig. Wenn ich die Proc unten einmal aufrufe erhalte ich die HBITMAP. In einer Schleife wird die Proc immer wieder aufgerufen. Dann bleibt sie bei res:=ExtractImage.Extract(hbmp); hängen un kehrt nicht zurück. Warum?

Code:
  res:=CoInitializeEx(nil, COINIT_APARTMENTTHREADED or COINIT_DISABLE_OLE1DDE);

  if Succeeded(res) then
  begin
    res:=ShellFolder.GetUIObjectOf(0, 1, PDataInfo(ChildItem.Data).RelativeIDL, IExtractImage, nil, Pointer(ExtractImage));

    if Succeeded(res) then
    begin
      sz.cx:=Width;
      sz.cy:=Height;

      Priority:=IEIT_PRIORITY_NORMAL;
      ImgColorDepth:=32;
      Flags:=IEIFLAG_ASPECT or IEIFLAG_ASYNC;

      GetLocationRes:=ExtractImage.GetLocation(buf, sizeof(buf), Priority, sz, ImgColorDepth, Flags);

      if (GetLocationRes = NOERROR) or (GetLocationRes = E_PENDING) then
      begin
        res:=ExtractImage.Extract(hbmp);

        if Succeeded(res) then
        begin
          result:=TBitmap.Create;
          result.Handle:=hbmp;
          result.Dormant;
        end;
      end;
    end;

    CoUninitialize;
  end;
Danke und beste Grüße

TiGü 25. Mär 2021 08:08

AW: IExtractImage
 
Delphi-Quellcode:
        res:=ExtractImage.Extract(hbmp);

        if Succeeded(res) then
Ist dann im hängen bleiben Fall res ungleich S_OK?

tomkupitz 25. Mär 2021 08:13

AW: IExtractImage
 
Kehrt gar nicht mehr aus res:=ExtractImage.Extract(hbmp); zurück. Ich kann res nicht auswerten.

TiGü 25. Mär 2021 09:32

AW: IExtractImage
 
Baue uns mal ein kleines, aber vollständiges Testprojekt.


Alle Zeitangaben in WEZ +1. Es ist jetzt 02:17 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz