Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic General > Re: Rewrite BAS...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 667 of 685
Post > Topic >>

Re: Rewrite BASIC language today?

by ArarghMail804NOSPAM@[EMAIL PROTECTED] Apr 28, 2008 at 07:38 AM

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.
 




 2 Posts in Topic:
Re: Rewrite BASIC language today?
"news@[EMAIL PROTECT  2008-04-28 01:50:17 
Re: Rewrite BASIC language today?
ArarghMail804NOSPAM@[EMAI  2008-04-28 07:38:52 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 19:31:01 CDT 2008.