On Mon, 28 Apr 2008 01:50:17 -0700 (PDT), "news@[EMAIL PROTECTED]
"
<news@[EMAIL PROTECTED]
> wrote:
>On Apr 28, 6:42 am, ArarghMail804NOS...@[EMAIL PROTECTED]
wrote:
>> For comparison, in BCET with this declare, either of these work:
>
>So can you, and if so how, call a 'modern' (e.g. OLE) API with a C++
>interface, such as the IPicture::get_Width function I listed the BBC
>BASIC code for earlier? The IPicture COM interface is really useful
>for loading GIF and JPEG images, and has been present ever since
>Windows 95.
>
This?
> DIM IPicture{QueryInterface%, AddRef%, Release%, get_Handle%, \
> \ get_hPal%, get_Type%, get_Width%, get_Height%, \
> \ Render%, set_hPal%, get_CurDC%, SelectPicture%, \
> \ get_Kee****iginalFormat%, put_Kee****iginalFormat%, \
> \ PictureChanged%, SaveAsFile%, get_Attributes%}
>
> !(^IPicture{}+4) = !gpPicture%
>
> SYS IPicture.get_Width%, gpPicture%, ^PictureWidth%
> SYS IPicture.get_Height%, gpPicture%, ^PictureHeight%
Possibly. I presume that the %'s refer to 32-bit things, not 16-bit.
I also presume that the "get_Width" entry point is 24 bytes past
"IPicture" or thereabouts. Have to figure that out.
oicdl.h shows this for get_Width:
HRESULT ( STDMETHODCALLTYPE __RPC_FAR *get_Width )(
IPicture __RPC_FAR * This,
/* [out] */ OLE_XSIZE_HIMETRIC __RPC_FAR *pWidth);
So, the DECLARE for get_Width would look something like:
DECLARE FUNCTION IPicture_get_Width ALIAS "IPicture+24" _
LIB "???" cdecl (BYVAL gpPicture AS LONG, _
PictureWidth AS LONG) AS LONG
and the call:
Rc = IPicture.get_Height(gpPicture, PictureHeigh)
Assuming all my guesses are correct, and the funky ALIAS works, and I
knew the DLL name and calling convention(cdecl, StdCall ...), this
should work.
You could use "IPicture.get_Width" for "IPicture_get_Width", but
currently that would get some boring warnings about period used not in
conjunction with TYPE elements.
Generally speaking, if you can write the DECLARE, BCET can call it.
The only thing I currently know won't work, is passing a small
structure in a register as one or more of the Console routines
expects. I don't remember which one just now. Maybe it was
SetConsoleCursorPosition? There are workarounds for that, though.
BTW, what does
!(^IPicture{}+4) = !gpPicture%
mean?
--
ArarghMail804 at [drop the 'http://www.'
from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html
To reply by email, remove the extra stuff from the reply address.


|