Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve images from EXE
Message
 
 
À
28/08/2007 08:57:27
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01250756
Message ID:
01250920
Vues:
28
The OleSaveToStream expects pointer to IPersistStream interface of an object as first parameter.

<snip>
>
>I've already tried #2, but I'm facing a DLL exception when using the function OLESAVETOSTREAM.
>Unfortunately, I've found really very few info about it on the web, NO SAMPLES AT ALL !!!
>
>I'm not sure if I have to pass the OLE object or the OLE handle, but it does not work in anyway.
>Maybe one of you can show me how to make it work ?
>
>Here's the code that I'm using to load the picture embedded in the EXE, without disk access:
>
>
>
LOCAL loImg
>m.loImg = LOADPICTURE(m.tcFilename)
>IF VARTYPE(loImg) = "O"
>   * Create a Stream object
>   LOCAL loStream as xfcMemoryStream
>   loStream = NEWOBJECT("xfcMemoryStream",XFCCLASS_SYSTEM)
>
>   DECLARE LONG OleSaveToStream IN OLE32.DLL OBJECT Obj, INTEGER Stream
>   * DECLARE LONG OleSaveToStream IN OLE32.DLL Integer @ImgHandle, INTEGER @Stream
>   OleSaveToStream(loImg, loStream.Handle)
>
>   *!* function OleSaveToStream(
>   *!* p1: access OLEOBJECT;
>   *!* p2: LPOLESTREAM)
>
>   *!* WINOLEAPI OleSaveToStream(
>   *!* IPersistStream * pPStm, //Pointer to the interface on the object
>   *!* // to be saved
>   *!* IStream * pStm //Pointer to the destination stream to
>   *!* // which the object is saved
>   *!* http://msdn2.microsoft.com/en-us/library/ms678407.aspx
>
>   This.SetStatus(xfcGdipLoadImageFromStream(m.loStream.Handle, @lhImage))
>   loStream.Dispose()
>ENDIF
>
>I'm getting an error in the "OleSaveToStream" call.
>DO you have any ideas, or am I using the wrong function for that ?
>
>Thnaks very much for your suggestions
>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform