Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing Struct Parameters to Dll
Message
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00763728
Message ID:
00763853
Views:
20
A short code sample for your SERIES structure:
LOCAL nLen, nHorizon, nPpc
nLen = 1200
nHorizon = 4
nPpc = 54
cBuffer = num2dword(m.nLen) + num2dword(m.nHorizon) +;
	num2dword(m.nPpc) + Repli(Chr(0), 32)  && 8 times by 4 bytes

FUNCTION num2dword(lnValue)
#DEFINE m0  256
#DEFINE m1  65536
#DEFINE m2  16777216
	IF lnValue < 0
		lnValue = 0x100000000 + lnValue
	ENDIF
	LOCAL b0, b1, b2, b3
	b3 = Int(lnValue/m2)
	b2 = Int((lnValue - b3*m2)/m1)
	b1 = Int((lnValue - b3*m2 - b2*m1)/m0)
	b0 = Mod(lnValue, m0)
RETURN Chr(b0)+Chr(b1)+Chr(b2)+Chr(b3)
I'm not completely sure about float * values. It might be that instead of Repli(Chr(0),32) you should allocate 8 memory blocks 4 bytes each. And write into each memory block a float value. For that you need a procedure converting Fox numeric to float format.

I do not have this conversion procedure availble right now. Peter Easson once posted a set of them on Wikis site. You can reach it as soon as this site will be available.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform