Hi
Byref argument type mismatch
apiUrl = "192.168.1.2:80/ISAPI/streaming/channels/01/picture"
UserName = "admin"
password = "12345."
Call SaveImageFromAPI(apiUrl, UserName, password, txttrno.Text)
--------------
Public Sub SaveImageFromAPI(apiUrl As String, UserName As String, Pwd As String, TrNo As String)
Thanks
Sophia CarterPosted Mar 19, 2025, 1:58 PM
Hello! It looks like you are encountering a Byref argument type mismatch in your code snippet. This issue typically arises when the data type of the arguments passed in a procedure or function call does not match the data type expected by the receiving procedure or function.
In your case, the `SaveImageFromAPI` procedure is expecting four arguments of type String: `apiUrl`, `UserName`, `Pwd`, and `TrNo`. However, when you are calling this procedure, you are passing `txttrno.Text`, which seems to be referencing a control that may not directly provide a String value.
To resolve this mismatch, you can ensure that `txttrno.Text` (which is likely a control like a TextBox) is explicitly converted to a String before passing it to the `SaveImageFromAPI` procedure. You can do this by using the `Convert.ToString(txttrno.Text)` or `txttrno.Text.ToString()` methods to explicitly convert the value to a String data type.
Here is an updated version of your code snippet with the conversion included:
By explicitly converting `txttrno.Text` to a String data type, you are ensuring that the data type matches the expected type in the `SaveImageFromAPI` procedure.
I hope this helps clarify the Byref argument type mismatch issue you are facing. If you have any more questions or need further assistance, feel free to ask!