Re: Visual Studio 2005 - Warning in the Error List Window



I'm receiving the same warning, and although this has been brought up
several times by other posters, I can't find the solution anywhere. I've
Googled and searched the newsgroups, but I'm at a loss as to the solution.

I create my own structure, then use it when I read from a file, but get the
warning each and every time I do so.
Structure addressEntry

<VBFixedString(ciSalesperson)> Public sSalesperson As String

<VBFixedString(ciBillingAddress1)> Public sBillingAddress1 As String

<VBFixedString(ciBillingAddress2)> Public sBillingAddress2 As String

<VBFixedString(ciBillingAddress3)> Public sBillingAddress3 As String

<VBFixedString(ciShippingAddress1)> Public sShippingAddress1 As String

<VBFixedString(ciShippingAddress2)> Public sShippingAddress2 As String

<VBFixedString(ciShippingAddress3)> Public sShippingAddress3 As String

End Structure

.. . .

Private Sub LoadAddress()

If Not Blank(comboboxBillToLine1.Text) Then

Dim Address As New addressEntry

Dim f As Integer = FreeFile()

FileOpen(f, sDataDirectory & "\address.dat", OpenMode.Random, , ,
Len(Address))

For l As Long = 1 To (LOF(1) \ Len(Address))

FileGet(f, Address, l)

If comboboxBillToLine1.Text.TrimEnd.ToLower =
Address.sBillingAddress1.TrimEnd.ToLower Then

textboxBillToLine2.Text = Address.sBillingAddress2.TrimEnd

textboxBillToLine3.Text = Address.sBillingAddress3.TrimEnd

textboxShipToLine1.Text = Address.sShippingAddress1.TrimEnd

textboxShipToLine2.Text = Address.sShippingAddress2.TrimEnd

textboxShipToLine3.Text = Address.sShippingAddress3.TrimEnd

textboxSalesperson.Text = Address.sSalesperson.TrimEnd

Exit For

End If

Next

FileClose(f)

End If

End Sub

"Tom McL." <tbmcl@xxxxxxxxx> wrote in message
news:e8PGHI4$FHA.1600@xxxxxxxxxxxxxxxxxxxxxxx
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



.



Relevant Pages

  • Re: question about some good practises
    ... Dim tValue As String = String.Empty ... variable 'myvar' is used before it has been assigned a value: ... Warning 3) is easy to solve: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Returning a value from another application
    ... of the variable warning from the excel module to Access ... Dim fName As String ...     For RCOUNT = RCOUNT To LastRow ...
    (microsoft.public.access.formscoding)
  • RE: Update table with unbound combo box with sql string
    ... Dim con As ADODB.Connection ... Dim strCombo22 As String ... Dim sql1 As String ... This method will bypass the standard Access warning, ...
    (microsoft.public.access.formscoding)
  • Re: Function Warning - Null Reference
    ... Warning 1 Function 'Dec2hms' doesn't return a value on all code paths. ... These include String, Integer, DateTime and Boolean ...
    (microsoft.public.dotnet.languages.vb)
  • Returning a value from another application
    ... I am calling an Excel module from Access and would like to know if the Excel ... of the variable warning from the excel module to Access ... Dim fName As String ...
    (microsoft.public.access.formscoding)