Publié : mar. 04/août/2009 15:16
En fait c'est tout simple..c'est pour ça que je me fait ch...depuis une semaine 
Je veux, enfin je voudrais, j'aimerais, ce serait gentil....avoir ce code qui me conviens tres bien, mais dans une DLL

Je veux, enfin je voudrais, j'aimerais, ce serait gentil....avoir ce code qui me conviens tres bien, mais dans une DLL
Code : Tout sélectionner
ProcedureDLL.l CreateArray(Parametre)
Static Passage, xx, *PointerString
Passage + 1
If Passage = 1
*PointerString = AllocateMemory(100000 * 4); Tableau de pointeur
If Parametre = 1
Lettre.s = "a"
Else
Lettre.s = "c"
EndIf
Else
If Parametre = 2
Lettre.s = "b"
Else
Lettre.s = "d"
EndIf
EndIf
For x = 1 To 4
xx + 1
LenString = Len(RSet("", xx, Lettre))
*String = AllocateMemory(LenString * 4)
PokeS(*String, RSet("", xx, Lettre))
PokeI(*PointerString + (xx * 4), *String)
Next
If Passage = 1
CreateArray(Parametre)
ReAllocateMemory(*PointerString, (xx * 4) + 4)
Passage = 0
xx = 0
EndIf
PokeI(*PointerString, #Null)
ProcedureReturn *PointerString
EndProcedure
Dim ArrayA.s(0)
ArrayA() = CreateArray(1)
Dim ArrayB.s(0)
ArrayB() = CreateArray(2)
For i = 1 To (MemorySize(ArrayA()) / 4) - 1
Debug "Premier essai = " + ArrayA(i)
Next
For i = 1 To (MemorySize(ArrayB()) / 4) - 1
Debug "Second essai = " + ArrayB(i)
Next