Some javascript/style in this post has been disabled (
why?)
I am having trouble importing external C functions.
I created a dll in Visual Studio using this syntax :
extern "C" __declspec(dllexport) void __cdecl setsigma(void);
here is the output from pedump on the resulting "t3.dll" :
At the end of this post are the rsults for the examples in the SP-Forth doc.
When it loads without error, I cannot see the Forth name for the function.
Thanks,
Dave
Dump of file T3.DLL
exports table:
Name: t3.dll
Characteristics: 00000000
TimeDateStamp: 491DC11A -> Fri Nov 14 11:19:06 2008
Version: 0.00
Ordinal base: 00000001
# of functions: 00000022
# of Names: 00000022
Entry Pt Ordn Name
0001115E 1 Hdot
00011014 2 HdotP1dot
000111A9 3 Hminus
000110E1 4 Hminus90
00011019 5 Hplus
0001119A 6 Hplus90
0001118B 7 Lminus
000110F5 8 Lminus90
00011195 9 Lplus
00011186 10 Lplus90
00011028 11 P0dot
00011172 12 PointXMatrix
00011258 13 U180
00011131 14 Uminus
0001110E 15 Uminus90
000110AF 16 Uplus
00011163 17 Uplus90
00011122 18 addHeading
00011064 19 calcTurtleDistance
00011109 20 crossprod
000111A4 21 getHeading
00011249 22 getHeadingPrime
0001119F 23 getHprime
00011005 24 getP0
0001100A 25 getP1
00011212 26 getsigma
00011235 27 initHeading
0001112C 28 normalize
000110DC 29 p02p1
000110BE 30 setHeading
000111C7 31 setHprime
00011221 32 setP0
00011226 33 setP1
00011253 34 setsigma
results for FP-Forth doc examples :
if you want to import automatically all DLL functions as forth words, use (for
stdcall)
example 1 :
REQUIRE UseDLL ~nn/lib/usedll.f
UseDLL "DLL name"
result :
SP-FORTH - ANS FORTH 94 for Win95/98/ME/NT/2000/XP
REQUIRE UseDLL ~nn/lib/usedll.f
Ok
UseDLL t3.dll
Ok
' setsigma
' setsigma
^ -321 - not found !
example 2 :
REQUIRE DLL ~ac/lib/ns/dll-xt.f
DLL NEW: "DLL name"
SP-FORTH - ANS FORTH 94 for Win95/98/ME/NT/2000/XP
REQUIRE DLL ~ac/lib/ns/dll-xt.f
Ok
DLL NEW: t3.dll
DLL NEW: t3.dll
^ -2003 WORD OR FILE NOT FOUND
example 3 :
REQUIRE USES_C ~af/lib/c/capi-func.f
USES_C "DLL name"
SP-FORTH - ANS FORTH 94 for Win95/98/ME/NT/2000/XP
REQUIRE USES_C ~af/lib/c/capi-func.f
CODE isn't unique
Ok
USES_C t3.dll
Ok
' setsigma
' setsigma
^ -321 - not found !
example 4 :
REQUIRE SO ~ac/lib/ns/so-xt.f
SO NEW: "DLL name"
SP-FORTH - ANS FORTH 94 for Win95/98/ME/NT/2000/XP
REQUIRE SO ~ac/lib/ns/so-xt.f
Ok
SO NEW: t3.dll
SO NEW: t3.dll
^ -2003 WORD OR FILE NOT FOUND
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Spf-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spf-dev