I have crazy passing parameters from my program in VB to function in DLL (wrote by VC++, Win32 DLL project).
This is a parts of code:
Declare Function Finding Lib "AB.dll" (ByVal P0 As String, ByVal P11 As Integer, ByVal P12 As Integer, ByVal P21 As Integer, ByVal P22 As Integer, ByVal P3 As Boolean, ByVal P4 As Boolean)
Finding "Test", 0, 5, -1, -1, False, True
AB_API void Finding (char *P0, int P11, int P12, int P21, int P22, bool P3, bool P4);
AB_API void Finding (char *P0, int P11, int P12, int P21, int P22, bool P3, bool P4)
So, when I try run the code, I have result in file RESULT.txt:
Only this and nothing more... :-)
When I try change the declaration in VB (ByVal to ByRef):
Declare Function Finding Lib "AB.dll" (ByRef P0 As String, ByRef P11 As Integer, ByRef P12 As Integer, ByRef P21 As Integer, ByRef P22 As Integer, ByRef P3 As Boolean, ByRef P4 As Boolean)
I have this result:
I don't understand 2 things:
1. Why do first variable pass nothing?
2. Why is there very big values pass in first integer in first example and all integers in second? What does it mean???