Solved

explicit conversion in VB.net

Posted on 2006-06-15
4
1,143 Views
Last Modified: 2012-08-13
Trying to clean up a warning

warning BC41999: Implicit conversion from 'System.ValueType' to 'ErrorViewer.TXTRecordType'
The warning is on the TextRecord Var

FileGet(nFileHandle, TextRecord, 1)

How come i Explicitly cast TextRecord as a System.ValueType
0
Comment
Question by:NESupply
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Expert Comment

by:neilprice
ID: 16914367
To explicitly cast you simply add "(ErrorViewer.TXTRecordType)" to your TextRecord var...

FileGet(nFileHandle, (ErrorViewer.TXTRecordType)TextRecord, 1)

Neil
0
 

Author Comment

by:NESupply
ID: 16914451
Yeah I tried that early. I get this error.

Error  - >  'TXTRecordType' is a type in 'ErrorViewer' and cannot be used as an expression.

Thanks
   Tim
0
 
LVL 6

Accepted Solution

by:
neilprice earned 125 total points
ID: 16915748
I'm sorry!

I thought I was in the C# forum.

Try using CType();

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vafctctype.asp

Hope this helps,
Neil
0
 
LVL 6

Expert Comment

by:manch
ID: 16918196
U Can use Functions :

Ctype()
or
DirectCast()

0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question