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

Pointers to DLLs

From: Jeffrey Massung <jma_at_mfire.com>
Date: Mon, 20 Oct 2003 15:47:09 -0500

More DLL fun.. Hopefully someone can help me with this little problem. I =
all
boils down updating a pointer passed to a C++ function.

Here's the C++:

extern "C" DLL_EXPORT void increment(int *x)
{
   (*x)++;
}

Now the Forth:

LIBRARY mydll.DLL
1 IMPORT: increment

VARIABLE x
1 x !

x increment DROP
x ?

Well, this fails. No error is produced, but the results are invalid, and =
SF
spits out a value (to the console) after execution of 'increment'. Perhap=
s I'm
missing something or not doing this right?

Any ideas appreciated, thanks!

Jeff

----------------------------------------------------------------------
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 Mon Oct 20 2003 - 13:52:50 PDT

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:33 PST