Error Converting Code From 6.0 To 2010

Jun 10, 2011

i was used to be vb 6.0. but now im starting with vb 2010 because 6.0 is old. but now i have a few problems with converting some things for my game that im making.

in 6.0 it was

modPlayer (module)
Public Player(1 To MAX_PLAYERS) as PlayerRec
Private Type PlayerRec
Name as string
Level as string
End Type

but this code gives in 2010 some errors; it says it should be structures right now?

Module modPlayerRec
Public Player(0 To 100) As PlayerRec
Structure PlayerRec
Public Name As String
End Structure
End Module

what should be the right code for vb 2010? this is not working what i have right now.

View 5 Replies


ADVERTISEMENT

VS 2010 Express: Converting Code From VB6 - Error 1 "MsgBox" Not Declared

Mar 7, 2012

When converting the project from VB6 to VB.net. (All links to this classes were deleted: Microsoft.VisualBasic.Compatibility¸ Microsoft.VisualBasic Import System System.Data System.Windows.Form, using Framework 2.0)

I have this errors: Error 1 "MsgBox" not declared. It may not be available due to its protection level....RFrm.vb 1481 9 R

Error 2 "MsgBox" not declared. It may not be available due to its protection level. ...RFrm.vb 1481 135 R

Private Sub _Command4_0Microsoft.VisualBasic.Left_Click(ByVal sender As System.Object,_ByVal e As System.EventArgs) Handles _Command4_0.Click

[CODE]...

And another question, off-topic. Which operators can be replaced with VB.net operators: IsNumeric, Mid, Microsoft.VisualBasic.Left.

The function checks for the input only the digits.

With Text9
If .Text <> "-" And Not IsNumeric(.Text) Then .Text =_
Microsoft.VisualBasic.Left(.Text, .SelectionStart - 1) &_
Mid(.Text, 1 + .SelectionStart)
End With

View 4 Replies

Raise An Event Error When Converting C# Code?

Jan 10, 2011

I have converted C# code to vb.net using the online converter tools.

Public Sub New()
InitializeComponent()
Me.Flip1Half.Completed += New EventHandler(AddressOf Flip1Half_Completed)

[Code].....

View 2 Replies

VS 2010 WebClient Get Error When Converting String To System.Net.IWebProxy

Sep 21, 2011

I am getting an error with this Dim Web As New WebClient Web.Proxy = "69.196.16.237:62159" It says runtime errors may occur when converting string to System.Net.IWebProxy What does that mean?

View 9 Replies

Converting C# Code To VB Code For Comparing Two Images

Jun 8, 2009

I m comparing two images in VB.Net..I get the code in C# & dat code is working 100 % Correctly..Now want to convert dat code to vb.net..& i need help in just converting two lines-

[code]...

View 6 Replies

VS 2010 - Debug - Code For A Payroll Calculator - Gives Me My Own Error Message Box

Feb 3, 2012

I have written the below code for a payroll calculator. When I run the program, it gives me my own error message box no matter if my number of hours fall within the 5-60 hours range as I have stipulated. Is there something wrong with my code? (well, obviously there is something wrong--I just cant find it!)

CODE:

'This program calculates the Gross and Net Pay as well as the Tax Deduction amount of an employee's wages when given the input of Employee Name, Tax Rate, Hours Worked, and Hourly Pay Rate.

CODE:

View 5 Replies

Converting The C# Code Which Works Into VB Code

May 13, 2012

I need assistance converting the following C# code which works into VB code. The code detects when a specific type of USB device is connected and disconnected and writes the status to a status strip:

[code]...

View 1 Replies

C# - Converting Code To .net?

Aug 3, 2010

I got this code from msdn[URL]..I have most of it converted but having an issue with the following sub getting it converted correctly Protected Overrides Sub AdjustEventHandlers(ByVal sender As

[Code]...

View 3 Replies

Converting A C++ Code To Vb ?

Jan 20, 2011

I am converting a c++ code to vb but there is a problem, i dont know how this code work, if you know what is type of SetFilter parameters and SetBitFilter tell me. i cant use SetBitFilter in vb because it give me an error this is cause of i dont declare them correctly or their values. but when i use SetFilter it work few second and it stop working and with a dialog that have 2 button (close and debug)

This is code in c++ :

CODE:

View 1 Replies

Converting BMP To AVI C# Code To .NET

Feb 16, 2009

I found some code on the net that is supposed to convert a BMP file into a AVI file.

[URL]

The example is in C# so i converted it using a C# to VB.NET converter and fixed a few of the conversion bugs. The code executes but fails on the line 'Throw New AviException("error for AVIFileOpen")' saying 'AVI exception unhandled'.

View 5 Replies

Converting C# Code To VB?

Jun 30, 2009

I have some code, that I am converting from C# to VB, in the code is the following line.

int index = ((int)document.GetCharAt(wordOffset +1)) % 256

that translates to something like this:

Dim index as Integer = CInt(document.GetCharAt(wordOffset + 1)) Mod 256

The problem is that the GetCharAt() function returns a Char type (pretty obvious from the name). VB throws an error saying that Type Char can't be converted to Type Integer. So my question is, what is the result of the explicit conversion in C# code?

View 6 Replies

Converting From VB6 Code To .NET?

Feb 5, 2010

I am currently in the process of converting a program I have developed from VB6/VBA to Visual Basic.NET. The object of this function is to run a query on an SQL Server Hosted database and output the results to Excel. I have a couple of last final problems though, in the old vb6 lines:

[Code]...

View 4 Replies

Converting Some C# Code To VB?

Sep 24, 2010

I never used delegate before Currently I am converting some C# code to VB.NET and am having some issue, it says

Error 2 Method 'Private Sub OnNewMessage()' does not have the same signature as delegate 'Delegate Sub OnChangeEventHandler(sender As Object, e As System.Data.SqlClient.SqlNotificationEventArgs)'.

[code]...

View 1 Replies

Converting This Code From .NET To C#?

Apr 14, 2009

I'm trying to convert the code below to C#?

Dim inFile As System.IO.FileStream
Dim binaryData() As Byte
Dim strFileName As String

[code]....

View 8 Replies

Converting VB 08 Code To PHP ?

Apr 12, 2009

I was looking for a way to get a direct link from mediafire's file hosting service. By default, when a user visits a download link, he will be presented with a download page where he has to wait for the download to be processed and then a link will appear.This link will appear in the div id 'download_link'.[url]

View 1 Replies

Converting VBA Code To .Net?

Mar 28, 2012

I have created a custom ribbon for Excel 2010. This ribbon has a custom tab with various custom buttons. I have these buttons programmed to run an existing Macro in Excel. This is functioning just fine, but I would rather have the button run the code instead of activating the Macro. Basically, the Macro inserts a template worksheet after the active sheet.how to convert this simple VBA code to VB.Net?

Sub Insert_Sheet_AfterActiveSheet()
Sheets.Add After:=ActiveSheet, Type:="C:template sheet.xls"
End Sub

View 7 Replies

.Net - Converting Code-snippet From C#?

Aug 9, 2009

I have problems in converting the following code-snippet from C# to VB.Net:

if ((currentItem.Tag as FileSystemKind?) != FileSystemKind.File)
{
if (currentFileName == GOBACK)

[code]......

View 3 Replies

2 Errors Converting C# To VB Code

Aug 15, 2012

I'm converting some C# code to VB.Net, as it's a language I know better, I've got some code that I can't figure out...

Dim mybtn As New ImageButton()
mybtn.ImageUrl = _imgUrl
Select Case _buttonType
Case ButtonType.Backpage

[CODE]...........

This is giving 2 errors:

Me.btnBackpage_Click = Delegate 'System.Web.UI.WebControls.CommandEventHandler' requires an 'AddressOf' expression or lambda expression as the only argument to its constructor.

And

mybtn.Command = 'Public Event Command(sender As Object, e As System.Web.UI.WebControls.CommandEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.

View 1 Replies

Asp.net - Converting Some Legacy .NET Code To C#?

Nov 18, 2009

Public Const COLUMN_MODEL_ORDER As String = MDL_ORDER.ColumnName

DataModel.Config.DefaultView is a System.Data.DataView

how can I convert it?:

Dim ModelOrder As Integer = 1
Dim DataModel As New ProfileDataModel(New DBConnection, Me.ProfileID)
If DataModel.Config.DefaultView.Count > 0 Then

[code]....

View 5 Replies

Converting .NET Code To VBScript?

Jun 26, 2009

I have this snippet of VB.NET code that I want to convert to VBScript. It basically starts Microsoft Word, displays the Open dialog and mail merges the selected document.

Dim oMissing As Object = System.Reflection.Missing.Value
Dim oEndOfDoc As Object = "\endofdoc"
Dim oFalse As Object = False
'Start Word and create a new document.
Dim oWord As Word._Application
Dim oDoc As Word._Document

[Code]...

View 2 Replies

Converting A .net Code Snippet To C#?

Mar 3, 2011

Visual Studio 2005.I was converting some of my source code to C#.However, when I was doing the code snippet below, I noticed I don't have the IsNumber method.Why is the IsNumber missing? I wanted to use it so that I can force a user to enter only numbers.

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar.IsNumber(e.KeyChar) = False Then

[code]....

View 4 Replies

Converting A Snippet Of Vb6 Code?

Jan 28, 2012

i am trying to port one of my old vb6 applications to vb 2008 Having trouble coverting this

Call cNavAndWait.navigateAndWait(WebBrowser1, "http://www.mysite.com")
Set HTML = WebBrowser1.Document
For Each HyperLink In HTML.links

[code]....

The associated html code im trying to click looks like this...

<a onclick="document.location.href = '../blah.php' + document.location.search; return false;" href="../files/blah.jpg">Click Here!</a>

View 2 Replies

Converting A String To Code?

Sep 21, 2009

I was trying to figure out how to convert a string (that the user would input to the program via a textbox) into actual code for the program to compile. For example, if the user was to enter: (5*100)+(20-3). How could you take that inputted string, and have the program solve it and return the value?

View 3 Replies

Converting C# To Vb 3 Lines Of Code?

Jan 2, 2012

i'm making a console program that consults a website of my work but it uses https and has a Untrusted certificate so i get this error: This Connection is Untrusted i did some research on the internet about this issue and come up with this code

//for testing purpose only, accept any dodgy certificate. public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)

[Code]...

View 6 Replies

Converting Code Snippet From C# To .NET?

Mar 7, 2010

All the automated, online converters weren't able to convert this code. Unfortunately my brief knowledge of C# has also let me down. The code originates from a blog, linked from another of my questions.

[Code]...

View 1 Replies

Converting From .NET Colour To Hex Code?

Oct 19, 2010

I need to convert a VB.NET colour to a hex code.Here is my code thus far:

TextBox1.Text = ColorTranslator.ToHtml(Button1.BackColor)

The back color of button 1 is red. However when I use this code the textbox types "red" instead of "#ff0000". Is this because when typing HTML, most normal people would type:

<font color="red">
<!--- Instead of typing --->
<font color="#ff0000">

View 3 Replies

Converting Java Code To .net?

Dec 10, 2010

where i can find the converter of code from java to vb.net.

View 2 Replies

Converting PDF To Tif Format In Code

Feb 5, 2007

way to do this without third party components? I have been trying to do it using a reference to Acrobat, but I I cant make it work... Specifically I would like to pass the Save As dialogue a filename and extension....

here is the code I am working with:

AcroXApp = CType(CreateObject("AcroExch.App"), Acrobat.CAcroApp)
'Removing toolbar buttons from the user interface
With AcroXApp

[Code].....

View 4 Replies

Converting This Code Snippet From C# To Vb?

Jan 27, 2011

i've tried all the online code converters but none of them work on this. explain to me how to transform this sniped it to vb.net?

[Code]...

View 1 Replies

Converting VB6 Code Snippet To .NET?

Jan 13, 2012

I am having a hard time converting this snippet to VB.NET

Function DecryptPassword(ByVal s As String) As String
Dim i As Integer
Dim sPass As String = s.Trim()

[code]....

It works well in VB6 but throws error when i VB.Net..

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved