I am getting an error when calling code in a dll - the same line of code works fine outside the dll i.e. if I put it in a prg and call the prg instead of the dll.
My calling program passes a form object as a parameter to the dll (or prg). The form object has an array property. I want the dll (or prg) to cycle through some code depending upon the number of rows in the array. The dll has several functions. The problem line of code within the function is the 2nd line in the following block of code (i.e. the FOR statement)
When I call the function in the dll I am getting - Function argument value, type, or count is invalid (Error 11) on the FOR statement line. Running the same code by calling a prg works OK.
IF !EMPTY(toForm.aMyArray[1,1])
What is odd is that the first line of code runs OK and the DLL does not error - so I believe it is accepting the form object and the forms array property.
Is there any particular reason that a line of code should run differently in a DLL as opposed to a PRG?
Thanks
Barry Sutton
My calling program passes a form object as a parameter to the dll (or prg). The form object has an array property. I want the dll (or prg) to cycle through some code depending upon the number of rows in the array. The dll has several functions. The problem line of code within the function is the 2nd line in the following block of code (i.e. the FOR statement)
When I call the function in the dll I am getting - Function argument value, type, or count is invalid (Error 11) on the FOR statement line. Running the same code by calling a prg works OK.
IF !EMPTY(toForm.aMyArray[1,1])
FOR i = 1 TO ALEN(toForm.aMyArray,1)
do_code
ENDFOR
do_code
ENDIFWhat is odd is that the first line of code runs OK and the DLL does not error - so I believe it is accepting the form object and the forms array property.
Is there any particular reason that a line of code should run differently in a DLL as opposed to a PRG?
Thanks
Barry Sutton