I found a DLL that generates/solves Sodoku puzzles here:
http://web.telia.com/~u88910365/
I've been able to open the library and examine the functions
but I'm having some problems calling the function.
The function is returning zero but no other errors.
The documentation is pretty thorough so I am hoping somebody can tell me where I'm going wrong (assuming the DLL is not at fault).
I'm pretty sure that I am doing something wrong since I don't use DLLs much.
Code: Select all
extern "C" __declspec(dllimport) int __stdcall Generate(int partGrid[9][9], int diff, int diffMin, int diffMax, int diagonalVers);
Code: Select all
; Sudoku DLL Test
; http://web.telia.com/~u88910365/
Dim grid.l(8,8)
diff.l = 1
diffMin.l=30
diffMax.l=35
;populate the array mostly with zeros
For x = 0 To 8
For y = 0 To 8
grid(x,y)=0
Next
grid(0,x)=x+1
Next
If OpenLibrary(0, "suo_09_eng.dll")
Debug CountLibraryFunctions(0)
If ExamineLibraryFunctions(0)
While NextLibraryFunction() <> 0
Debug LibraryFunctionName()
Wend
EndIf
*F = IsFunction(0, "Generate")
If *F
Debug *F
Debug CallCFunctionFast(*F, *grid, *diff,*diffmin, *diffmax, #False)
EndIf
CloseLibrary(0)
EndIf
For x = 0 To 8
For y = 0 To 8
Debug grid(x,y)
Next
Next