473,721 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
+ 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.ValueTy pe' to 'MyProgram.mMyM odule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.
C:\Documents and Settings\Tom\My Documents\Visua l Studio 2005\Projects\
MyProgram\fMyFo rm.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 SeasonToDateDat a(,) 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.It ems.Item(1).ToS tring
filenum = FreeFile()
Try
FileOpen(filenu m, Application.Sta rtupPath & "/" & sFileName,
_
OpenMode.Random , OpenAccess.Read , OpenShare.Share d,
pRecLength)
FileGet(filenum , myRecord)
FileClose(filen um)
Catch ex As Exception
MsgBox(ex.ToStr ing) ' Show friendly error message.
Finally
End Try
End Sub
End Class
Thanks

Tom
Dec 13 '05 #1
6 5766
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.co m> wrote in message
news:e8******** ******@TK2MSFTN GP11.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.ValueTy pe' to
'MyProgram.mMyM odule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.
C:\Documents and Settings\Tom\My Documents\Visua l Studio 2005\Projects\
MyProgram\fMyFo rm.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 SeasonToDateDat a(,) 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.It ems.Item(1).ToS tring
filenum = FreeFile()
Try
FileOpen(filenu m, Application.Sta rtupPath & "/" &
sFileName, _
OpenMode.Random , OpenAccess.Read , OpenShare.Share d,
pRecLength)
FileGet(filenum , myRecord)
FileClose(filen um)
Catch ex As Exception
MsgBox(ex.ToStr ing) ' 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.ValueTy pe' to 'MyProgram.mMyM odule.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
<VBFixedStrin g> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateDat a(,) 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(filenu m, 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.It ems.Item(1).ToS tring
filenum = FreeFile()
Try
FileOpen(filenu m, Application.Sta rtupPath & "/" & sFileName,_
OpenMode.Random , OpenAccess.Read , OpenShare.Share d,pRecLength)

FileGet(filenum , myRecord)
FileClose(filen um)
Catch ex As Exception
MsgBox(ex.ToStr ing) ' 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.co m> wrote in message
news:Od******** ******@TK2MSFTN GP11.phx.gbl...
Cesar,
This is the warning message I get when I hover over the
green-underlined variable:

Implicit conversion from 'System.ValueTy pe' to
'MyProgram.mMyM odule.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
<VBFixedStrin g> Public filename As String
Public RainData(,) As Single
Public SnowData(,) As Single
Public SeasonToDateDat a(,) 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(filenu m,
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.It ems.Item(1).ToS tring
filenum = FreeFile()
Try
FileOpen(filenu m, Application.Sta rtupPath & "/" & sFileName,_
OpenMode.Random , OpenAccess.Read , OpenShare.Share d,pRecLength)

FileGet(filenum , myRecord)
FileClose(filen um)
Catch ex As Exception
MsgBox(ex.ToStr ing) ' 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.co m> wrote in message
news:uQ******** ********@TK2MSF TNGP14.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( ciBillingAddres s1)> Public sBillingAddress 1 As String

<VBFixedString( ciBillingAddres s2)> Public sBillingAddress 2 As String

<VBFixedString( ciBillingAddres s3)> Public sBillingAddress 3 As String

<VBFixedString( ciShippingAddre ss1)> Public sShippingAddres s1 As String

<VBFixedString( ciShippingAddre ss2)> Public sShippingAddres s2 As String

<VBFixedString( ciShippingAddre ss3)> Public sShippingAddres s3 As String

End Structure

.. . .

Private Sub LoadAddress()

If Not Blank(comboboxB illToLine1.Text ) Then

Dim Address As New addressEntry

Dim f As Integer = FreeFile()

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

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

FileGet(f, Address, l)

If comboboxBillToL ine1.Text.TrimE nd.ToLower =
Address.sBillin gAddress1.TrimE nd.ToLower Then

textboxBillToLi ne2.Text = Address.sBillin gAddress2.TrimE nd

textboxBillToLi ne3.Text = Address.sBillin gAddress3.TrimE nd

textboxShipToLi ne1.Text = Address.sShippi ngAddress1.Trim End

textboxShipToLi ne2.Text = Address.sShippi ngAddress2.Trim End

textboxShipToLi ne3.Text = Address.sShippi ngAddress3.Trim End

textboxSalesper son.Text = Address.sSalesp erson.TrimEnd

Exit For

End If

Next

FileClose(f)

End If

End Sub

"Tom McL." <tb***@cwnet.co m> wrote in message
news:e8******** ******@TK2MSFTN GP11.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.ValueTy pe' to
'MyProgram.mMyM odule.Record'
in copying the value of 'ByRef' parameter 'Value' back to the matching
argument.
C:\Documents and Settings\Tom\My Documents\Visua l Studio 2005\Projects\
MyProgram\fMyFo rm.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 SeasonToDateDat a(,) 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.It ems.Item(1).ToS tring
filenum = FreeFile()
Try
FileOpen(filenu m, Application.Sta rtupPath & "/" &
sFileName, _
OpenMode.Random , OpenAccess.Read , OpenShare.Share d,
pRecLength)
FileGet(filenum , myRecord)
FileClose(filen um)
Catch ex As Exception
MsgBox(ex.ToStr ing) ' 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
2591
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: OSTDLL, Configuration: Debug Win32 ------ Compiling... StdAfx.cpp
0
774
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: OSTDLL, Configuration: Debug Win32 ------ Compiling... StdAfx.cpp
7
8148
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 in code that I write in the *.aspx.vb and *.ascx.vb files. Why is it no longer automatically declaring the controls? Is there a way to manually force Visual Studio 2005 to regenerate these files? Is there a setting somewhere that could have...
1
2207
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 this happening. Is there anything that could have caused this? Does anyone know of a way to fix it? Thanks. -- Nathan Sokalski njsokalski@hotmail.com http://www.nathansokalski.com/
1
2341
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 Warning in the Error List tab at the bottom of the screen: Generation of designer file failed: The relative virtual path '?/' is not allowed here. C:\Inetpub\wwwroot\CAT_aspnet\worldnews.aspx 0 0 CAT_aspnet
0
3533
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 1 (KB926601) Hotfix for Microsoft Visual Studio 2005 Professional Edition - ENU (KB933608) Windows XP, SP2.
0
6680
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, and started using the Microsoft Platform SDK for XP SP2, the errors disappeared, but I am now getting numerous warnings (macro redefinitions) as follows: StdAfx.cpp WINVER not defined. Defaulting to 0x0502 (Windows Server 2003) C:\Program...
0
1991
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 where you can double click a compile error/warning message and be guided to the file/line in question. Using sed to filter output from the compiler i managed to make the error output look like the ones generated from the regular compiler, and...
0
7330
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 beginning CIS student who is struggling to get their programs working. I work in the computer lab at the college I'm attending and I see many students who don't know how to use the IDE for best results. Visual Studio automatically creates a number of...
0
8834
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9365
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9212
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9127
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8002
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4483
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4748
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2569
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.