T
Tom McL.
I'm trying to move a program that was designed using Visual Studio 2003 and
(Visual Basic) into Visual Studio 2005. When it runs I get the following
warning in the
Error List Window and I'm not sure how to correct it. The program runs fine
except for the warning. The warning puts a green squiggle line under
MyRecord
in the (Private Sub GetRecord()).
Warning Message:
Implicit conversion from 'System.ValueType' to 'MyProgram.mMyModule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.
C:\Documents and Settings\Tom\My Documents\Visual Studio 2005\Projects\
MyProgram\fMyForm.vb 3700 34 MyProgram
Module level declare:
Public Structure Record
<VBFixedString(8)> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateData(,) As Single
End Structure
Public myRecord As Record
End Module
Public Class fMyForm
Private Sub GetRecord()
Dim filenum As Short
Dim sFileName As String
'open file file and get record
sFileName = ListBoxFiles.Items.Item(1).ToString
filenum = FreeFile()
Try
FileOpen(filenum, Application.StartupPath & "/" & sFileName,
_
OpenMode.Random, OpenAccess.Read, OpenShare.Shared,
pRecLength)
FileGet(filenum, myRecord)
FileClose(filenum)
Catch ex As Exception
MsgBox(ex.ToString) ' Show friendly error message.
Finally
End Try
End Sub
End Class
Thanks
Tom
(Visual Basic) into Visual Studio 2005. When it runs I get the following
warning in the
Error List Window and I'm not sure how to correct it. The program runs fine
except for the warning. The warning puts a green squiggle line under
MyRecord
in the (Private Sub GetRecord()).
Warning Message:
Implicit conversion from 'System.ValueType' to 'MyProgram.mMyModule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.
C:\Documents and Settings\Tom\My Documents\Visual Studio 2005\Projects\
MyProgram\fMyForm.vb 3700 34 MyProgram
Module level declare:
Public Structure Record
<VBFixedString(8)> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateData(,) As Single
End Structure
Public myRecord As Record
End Module
Public Class fMyForm
Private Sub GetRecord()
Dim filenum As Short
Dim sFileName As String
'open file file and get record
sFileName = ListBoxFiles.Items.Item(1).ToString
filenum = FreeFile()
Try
FileOpen(filenum, Application.StartupPath & "/" & sFileName,
_
OpenMode.Random, OpenAccess.Read, OpenShare.Shared,
pRecLength)
FileGet(filenum, myRecord)
FileClose(filenum)
Catch ex As Exception
MsgBox(ex.ToString) ' Show friendly error message.
Finally
End Try
End Sub
End Class
Thanks
Tom