Ok, I installed VB6 and got your code working.
The first change is that apparently VB declares arrays so you specify just the upper bound not the number of elements in the array as I thought. This means the API_OPDII_MSGPACKET type was incorrect it should be:
Code:
Type API_OBDII_MSGPACKET
m_dwTimeRecieved As Long
m_iNumDataBytes As Byte
m_Header(0 To API_OBDII_NUMHEADERBYTES - 1) As Byte
m_Data(0 To API_OBDII_NUMDATABYTES - 1) As Byte
End Type
The reason why there was 205 all over the place was because the data array was never initialized. API_OBDII_Mode1_ResetData m_lpUser should be called before calling any AddOBDPID calls. The reason why you weren't getting good values in the m_Data varibles that were filled during the GetPacket call was because the type was incorrect.
You also need to call GetPacket for every OBD packet you need to retrieve
i.e.
Code:
API_OBDII_Mode1_GetPacket m_lpUser, eOBDPIDTimingAdvance, lpMsgPacket
The last thing I found was that you declared the strings as follows:
Code:
Dim szPlugInName, szPluginComment, szVersion As String
Since you didn't specify a type for PluginName and comment it made them variants. You need to explicitly specify the type after every vaible like so:
Code:
Dim szPlugInName As String
Dim szPluginComment As String
Dim szVersion As String
You should be able to retrive the name and comment with that now.
I have attached the updated VB code.