0

'Here is my declarations:

Declare Function atxml_ReadCmds Lib "AtXmlApi_Dbg.dll" (ByVal resourceName As String, _
ByVal ReadBuffer As String, _
ByVal numberBytesToRead As String, _
ByRef numBytesRead As Integer) As Integer

Global resourceName As String
Global ReadBuffer As String * 255
Dim NBR As Integer 'Number of Bytes Read
Dim numberBytesToRead As Integer

'And here is my function call

ErrorStatus& = atxml_ReadCmds(resourceName, _
ReadBuffer, _
numberBytesToRead, _
NBR&)

'what is wrong?
'The compile error says:
'Type-declaration character does not match declared data type
'the highlight is on the NBR&

3
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by Yomet
0

um, is this right?
ByVal numberBytesToRead As String, shouldn't that be type int?

you declare it here as an int
Dim numberBytesToRead As Integer

0

Hi,

I noticed another thing that might make your code so bonkers, when you call the function you call it with NBR&, however the "&" is the type declaration character for the Long data type so what you're actually doing is declaring it as an Integer and then trying to type cast it as long. I don't think VB likes that, other languages yes but not VB.

Hope this helps

Yomet

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.