Bonjour/Hello
when I declare string variable in a function of DLL, that works well. but not with numric data.
ex :
declare SQLRowCount as "SQLRowCount" of "odbc32.dll"
SQLstmt as long
rowcount as short byaddress
result as short
end declare
in program :
SQLRowcount.execute, and SQLRowCount.rowcount give wrong result
but if I declare and pass the adresse it is good
ex :
declare SQLRowCount as "SQLRowCount" of "odbc32.dll"
SQLstmt as long
rowcount as long
result as short
end declare
SQLRowcount.rowcount = Varptr(short_var)
SQLRowcount. execute
short_var have the good value.
What is wrong with the first form?
Merci/Thanks.
Bruno
API : Short, Integer and Long ByAddress
API : Short, Integer and Long ByAddress
hi, byaddress is only for strings, numerics are alway`s byaddress.
byaddress for strings is used by windows if a pointer to a string block is used by the dll call.
best regards
byaddress for strings is used by windows if a pointer to a string block is used by the dll call.
best regards
-
- Posts: 11
- Joined: Fri Aug 10, 2012 6:45 am
API : Short, Integer and Long ByAddress
Bonjour, Hello
thnakyou for the answer , but i try , and i have an access violation in my program!!! with this 2 types of writing
1) I declare : rowcount as long, and use by fonction_name.rowcount=long_var
2) I declare : rowcount as long byaddress, and use by fonction_name.rowcount=long_var
message error : Access violation at adresse4DE2C43A in module "odbcjt32.dll". Write of address 000000004.
Modify le 14 Aug 2012 : 4 (the addresse of the message) is the previous value of the variable, so I think that it is the value and not the address which is giving ...
i am perplexe...
but it is not a blocking error, I use the VarPtr function to give the address, and that`s good.
au revoir/ Bye
Bruno.
thnakyou for the answer , but i try , and i have an access violation in my program!!! with this 2 types of writing
1) I declare : rowcount as long, and use by fonction_name.rowcount=long_var
2) I declare : rowcount as long byaddress, and use by fonction_name.rowcount=long_var
message error : Access violation at adresse4DE2C43A in module "odbcjt32.dll". Write of address 000000004.
Modify le 14 Aug 2012 : 4 (the addresse of the message) is the previous value of the variable, so I think that it is the value and not the address which is giving ...
i am perplexe...
but it is not a blocking error, I use the VarPtr function to give the address, and that`s good.
au revoir/ Bye
Bruno.
API : Short, Integer and Long ByAddress
I think this is possible, sometimes a dll function needs a variable withe an adress where it can put`s his data. And not the variable itself. I otherwords it look at the content of the variable to get the address of the other.
I hope this will help a bit.
best regards
I hope this will help a bit.
best regards
-
- Posts: 3
- Joined: Sat Aug 27, 2016 7:16 am
API : Short, Integer and Long ByAddress
excellent...thank you for sharing