'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, _

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

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


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