Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing Struct Parameters to Dll
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00763728
Message ID:
00763853
Vues:
19
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform