473,473 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Visual Studio 2005 - Warning in the Error List Window

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
Dec 13 '05 #1
6 5740
You double-clicked the green-underlined message so VS can show the error
line? If no, do it and post the block of code, please. I think the code you
posted is not that one it cause the message.

[]
Cesar
"Tom McL." <tb***@cwnet.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...
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

Dec 13 '05 #2
Cesar,
This is the warning message I get when I hover over the
green-underlined variable:

Implicit conversion from 'System.ValueType' to 'MyProgram.mMyModule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.

And it is the same message I see when I open the Error List Window.

The first block of code is my Module level declare of the structure named
Record.

Module level declare:
Public Structure Record
<VBFixedString> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateData(,) As Single
End Structure

Public myRecord As Record
End Module
The second block is from my Public Class fMyForm.
The green-underlined variable is "myRecord" in "FileGet(filenum, myRecord)".
I hope
this is what you need.

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


Dec 13 '05 #3
I need the FileGet( ) signature, I'm looking for the ByRef and ByVal tip.
You tried change all the parameters of that function to ByVal to see if it
works?


"Tom McL." <tb***@cwnet.com> wrote in message
news:Od**************@TK2MSFTNGP11.phx.gbl...
Cesar,
This is the warning message I get when I hover over the
green-underlined variable:

Implicit conversion from 'System.ValueType' to
'MyProgram.mMyModule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.

And it is the same message I see when I open the Error List Window.

The first block of code is my Module level declare of the structure named
Record.

Module level declare:
Public Structure Record
<VBFixedString> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateData(,) As Single
End Structure

Public myRecord As Record
End Module
The second block is from my Public Class fMyForm.
The green-underlined variable is "myRecord" in "FileGet(filenum,
myRecord)". I hope
this is what you need.

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

Dec 13 '05 #4
Cesar,

Far as I can tell FileGet() will not except anything but byRef.
Dec 14 '05 #5
Can you build a sample (some pieces of code) and post a link here? This
sample need to have that mencioned issue, so we can simulate the error and
try discover the cause.

[]s
Cesar
"Tom McL." <tb***@cwnet.com> wrote in message
news:uQ****************@TK2MSFTNGP14.phx.gbl...
Cesar,

Far as I can tell FileGet() will not except anything but byRef.

Dec 14 '05 #6
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." <tb***@cwnet.com> wrote in message
news:e8**************@TK2MSFTNGP11.phx.gbl...
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

Apr 21 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gerd | last post by:
Hello, I want to port an MFC Application from Visual Studio 6 MFC application to Visual C++ 2005 express edition beta. While building i get following error: ------ Build started: Project:...
0
by: gerd | last post by:
Hello, I want to port an MFC Application from Visual Studio 6 MFC application to Visual C++ 2005 express edition beta. While building i get following error: ------ Build started: Project:...
7
by: Nathan Sokalski | last post by:
I am an ASP.NET developer, and Visual Studio 2005 seems to have stopped declaring the controls that I add in the *.designer.vb files, therefore forcing me to manually add them before I can use them...
1
by: Nathan Sokalski | last post by:
Visual Studio 2005 recently stopped generating the *.designer.vb files for my *.aspx and *.ascx files. I am using Service Pack 1, and do not believe I did anything differently than normal prior to...
1
by: Nathan Sokalski | last post by:
Visual Studio 2005 unexpectedly stopped generating the *.designer.vb files for *.aspx and *.ascx files. After a few days of frustration trying to fix this, I noticed that it had the following...
0
by: fischermx | last post by:
Environment: Microsoft Visual Studio 2005 Version 8.0.50727.762 (SP.050727-7600) Microsoft .NET Framework Version 2.0.50727 Microsoft Visual Studio 2005 Professional Edition - ENU Service Pack...
0
by: marathoner | last post by:
I am currently migrating my Visual C++ 6.0 applications to Visual Studio 2005. I am getting compiler errors involving the VS2005's platform SDK. When I removed directory references to that SDK,...
0
by: =?Utf-8?B?VWxmIFRob3JzZW4=?= | last post by:
I use Visual Studio 2005 for a C-project using an external compiler, and came up with the idea that error parsing would be neat, i.e. enabling the functionality available for a "normal" build...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.