I've found an .ov2 parser, but it has been abandoned by the developer a few years ago. Can't find him unfortunately. Tried to convert it to VB.NET without any luck. Perhaps there's a way without the dll, but....
I can't get it to work and was wondering if someone here knows.
Code:
ReadOV2(Application.StartupPath & "\test.ov2")
Error 1 Reference to a non-shared member requires an object reference. (Readov2)
Imported everything, but no luck here.
Can't attach the dll, so I included the source:
Last edited by Radjesh Klauke; May 15th, 2012 at 03:03 PM.
1) created a new ClassLib;
2) imported your classes;
The following Errors Occur:
Error 1 'ReadOnly' variable cannot be the target of an assignment. Line 19 col 13 OV2Parser
Error 2 Option Strict On disallows implicit conversions from 'Long' to 'Integer'. Line 49 col 48 OV2Parser
Error 3 Overload resolution failed because no accessible 'Read' can be called with these arguments:
'Public Overridable Function Read(buffer() As Byte, index As Integer, count As Integer) As Integer': Option Strict On disallows implicit conversions from 'Long' to 'Integer'.
'Public Overridable Function Read(buffer() As Char, index As Integer, count As Integer) As Integer': Value of type '1-dimensional array of Byte' cannot be converted to '1-dimensional array of Char' because 'Byte' is not derived from 'Char'.
'Public Overridable Function Read(buffer() As Char, index As Integer, count As Integer) As Integer': Option Strict On disallows implicit conversions from 'Long' to 'Integer'. Line 50 col 13 OV2Parser
Warning 4 Function 'SerializeRectangle' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. Line 301 col 5 OV2Parser
Warning 5 Function 'SerializeSimplePOI' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. Line 356 col 5 OV2Parser
Error 2/3 isn't interesting cause I fixed it easily, but the rest not.
Code:
Dim bytesRead As Byte() = New Byte(CInt(br.BaseStream.Length - 1)) {}
br.Read(bytesRead, 0, CInt(br.BaseStream.Length))
EDIT: added "Return returnByte" in the 2 functions, no warnings anymore.
Last edited by Radjesh Klauke; May 16th, 2012 at 03:14 AM.
I remove the "readonly" and compiled it.
Works great, but I'd really like to to know how to loop through the ov2 to return all the values.
There are 4 values you can grab from the ov2: Lat/Long/Name/Telephone. I would like to list them something like:
1 lat, long, name, telephone
2 lat, long, name, telephone