programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Constants from a 3rd Party DLL

From: Charles Melice <3d_at_forthcad.com>
Date: Wed, 19 Apr 2006 11:22:36 +0200

----- Original Message -----
From: "Jason Damisch" <jasondamisch_at_yahoo.com>
To: <sftalk_at_forth.com>
Sent: Wednesday, April 19, 2006 9:08 AM
Subject: [sftalk] Constants from a 3rd Party DLL

> Suppose I want to program through a DLL. The DLL uses
> constants whose values I can't find in the
> documentation. Is it possiable to gather them from
> the library itself?

We can declare them by hand in the Forth source,
for instance:

    \ found in /dev/c/uvaprog.h
    $1001 constant UVA_SOMECONST

Normally, those extra constants reside in a provided
include file.

\ Another syntax: { : token bl word count ; }

    : #define ( "const" "value" -- )
        80 r-alloc >r
        token r@ place
        token pad place
        s" CONSTANT " pad append
        r> count pad append
        pad count evaluate ;

    #define UVA_SOMECONT $1001

\ Notice the following definition don't work. Why ?

    : #define ( "const" "value" -- )
        token
        token pad place
        s" CONSTANT " pad append
        ( a n) pad append
        pad count ( evaluate) type ; \ $1001 CONSTANT $1001OMECONT

    #define UVA_SOMECONT $1001

Charles

>
> Jason
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
> For list command help, send subject "help" to sftalk-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product support and
> bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
>

----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Wed Apr 19 2006 - 02:23:42 PDT

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:21 PST