Bug oder fehlverwendung des Arrays als übergabeparameter, oder liegt es doch an CallFunctionFast?
Habs bei Anfänger gepostet, da ich nicht weiß, ob es an mir oder der Sprache liegt..
Code: Alles auswählen
;---SNIP---
EnableExplicit
Structure multiDatatype
type.l ; #PB_Integer, #PB_String, ...
StructureUnion
integer.i
long.l
double.d
float.f
quad.q
byte.b
ascii.a
character.c
word.w
unicode.u
*pointer
EndStructureUnion
string.s
EndStructure
Structure t_dispatch
*func
Array Param.multiDatatype(10); max 10 parameter (one dimension)
EndStructure
Procedure DispatchMe(Array Param.multiDatatype(1)) ; one dimension expected
Debug "x" ; Breakpoint me and I'll crash [PB 4.50RC2 x86, Win7x64] -- Bug or programmers failure?
; Investigation Note: I crashes, because the Debugger want to dereference the Array...
EndProcedure
;---SNIP---
;...
;---SNIP---
; Allocate and Initialize dispatch structure
Define *temp.t_dispatch = AllocateMemory(SizeOf(t_dispatch))
InitializeStructure(*temp, t_dispatch)
*temp\func = @DispatchMe()
; But now if i comment those lines out it'll work
; But then the funcion only gets a Array with the size -1, not 10
; I thinks thats the error... But don't know why...
; If i would only use a .s Array, the error won't happen in the first place
; but after dereference the Array, the program also crash...
*temp\Param(0)\type = #PB_Long
*temp\Param(0)\long = 1000
;---SNIP---
;...
;---SNIP---
; So maybe the Problem is within here...
; Can't I push the Array as a CallFunctionFast Parameter?
CallFunctionFast(*temp\func, *temp\Param())
;---SNIP---
Danke.
Blackskyliner