Page 1 of 1

How to pass array parameter to dllcall?

Posted: 28 May 2023, 02:25
by Hobby77
this is a dll function from C program:

Code: Select all

__declspec(dllexport) int normqsp(double* values)
this is my script:

Code: Select all

   values:= [0.12 , 2.12 , 3.12]

   valuesP := Buffer(8 * values.Length,0)
   loop values.Length 
         NumPut("Double", values[A_Index],valuesP,8*(A_Index-1))

   DllCall("Project1.dll\normqsp","ptr",valuesP,"Int")
It seems to get stuck while running the dllcall and the cpu spike is high, am I doing something wrong?

Re: How to pass array parameter to dllcall?

Posted: 28 May 2023, 06:10
by just me
Does the function expect a fix number of values?

Re: How to pass array parameter to dllcall?  Topic is solved

Posted: 28 May 2023, 07:05
by swagfag
the ahk code checks out. the problem is in ur C function