473,508 Members | 2,329 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb6 to asp.net conversion question

pb
Hi,
I am trying to convert some VB6 code to ASP.NET (as a way of
learning).

How would I declare the following in and vb.net code module?

Public Type POINTAPI()
x As Double
y As Double
End Type

Cheers,

Pb.

Jun 2 '07 #1
4 1573
Do you have Visual Studio 2003 ?

If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" ).

It *really* helps when you want to convert VB6 to VB.NET.

See:
http://www.asp.net/migrationassistan...sptoaspnet.htm

There's instructions for batch conversion from the command-line, too.
That makes it real easy to copy a hole directory and conert all the files.

The converter adds a lot of code comments, too,
so you'll get a lot of hints for a lot of converted code.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"pb" <ph**********@hotmail.comwrote in message
news:11*********************@q19g2000prn.googlegro ups.com...
Hi,
I am trying to convert some VB6 code to ASP.NET (as a way of
learning).

How would I declare the following in and vb.net code module?

Public Type POINTAPI()
x As Double
y As Double
End Type

Cheers,

Pb.

Jun 2 '07 #2
I forgot to add, there's a handy comparison between VB6 and VB.NET here :
http://www.ondotnet.com/pub/a/dotnet...ex.html?page=1

In page 2, the guide explains :

In VB 6, a structure or user-defined type is declared using the Type...End Type structure.

In VB .NET, the Type statement is not supported.

Structures are declared using the Structure...End Structure construct.

Also, each member of the structure must be assigned an access modifier,
which can be Public, Protected, Friend, ProtectedFriend, or Private.

(The Dim keyword is equivalent to Public in this context.)

For instance, in page 2, the VB 6 user-defined type:

Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

is defined in VB .NET as:

Structure RECT
Public Left As Long
Public Top As Long
Public Right As Long
Public Bottom As Long
End Structure

You'll find that guide quite useful.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:un**************@TK2MSFTNGP03.phx.gbl...
Do you have Visual Studio 2003 ?

If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" ).

It *really* helps when you want to convert VB6 to VB.NET.

See:
http://www.asp.net/migrationassistan...sptoaspnet.htm

There's instructions for batch conversion from the command-line, too.
That makes it real easy to copy a hole directory and conert all the files.

The converter adds a lot of code comments, too,
so you'll get a lot of hints for a lot of converted code.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"pb" <ph**********@hotmail.comwrote in message
news:11*********************@q19g2000prn.googlegro ups.com...
>Hi,
I am trying to convert some VB6 code to ASP.NET (as a way of
learning).

How would I declare the following in and vb.net code module?

Public Type POINTAPI()
x As Double
y As Double
End Type

Cheers,

Pb.



Jun 2 '07 #3
Hi Juan,

Will not the migration assistant run by default when we open a VB6
application using dotnet?
Or should I do as you said
"If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" )."

I would like to know the difference..if any..

Jun 6 '07 #4
re:
!Will not the migration assistant run by default when we open a VB6 application using dotnet?

Yes, which is why I suggest you save a copy of the page before opening it.

If you don't save a copy, you'll lose your original file...permanently.
That might have consequences for you.


Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
<ve*********@gmail.comwrote in message
news:11**********************@i38g2000prf.googlegr oups.com...
Hi Juan,

Will not the migration assistant run by default when we open a VB6
application using dotnet?
Or should I do as you said
"If so, save a copy of the page which has your VB6 code and
use the Migration Assistant ( "File", "Open", "Convert" )."

I would like to know the difference..if any..

Jun 6 '07 #5

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

Similar topics

2
3077
by: Russell Reagan | last post by:
In a newer version of a chess program I am writing, I have created classes that are (more or less) drop in replacements for things that used to be plain old integer or enumerated variables (colors,...
5
3022
by: Vijai Kalyan | last post by:
Hello, I have come back to C++ after a couple of years with Java so I am quite rusty and this question may seem poor: My platform is Windows XP with MSVC 7.1. I have a class with a...
7
3249
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
26
3776
by: David W. Fenton | last post by:
A client is panicking about their large Access application, which has been running smoothly with 100s of thousands of records for quite some time. They have a big project in the next year that will...
31
6575
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
4
6467
by: Nikhil Patel | last post by:
Hi all, I am a VB6 programmer and learning C#. I am currently reading a chapter on types. I have question regarding enums. Why do we need to convert enum members to the value that they represent?...
2
6859
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
47
2813
by: rawCoder | last post by:
Hi, Just wanted to know if there is any speed difference between VB conversion Keywords like CInt, Clng, CStr, CDbl, CBool etc. ..NETs Convert.To<...> methods. And which is better to be...
1
2156
by: hunter hou | last post by:
Hello,Please look at the following code(from C++ in a nutshell) and my questions.Thanks,***Hunter... typedef void (*strproc)(const char*); void print(const char* str) { std::cout << "const...
21
2417
by: REH | last post by:
It it permissible to use the constructor style cast with primitives such as "unsigned long"? One of my compilers accepts this syntax, the other does not. The failing one chokes on the fact that the...
0
7225
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,...
0
7123
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
7326
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
7046
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
7498
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
4707
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
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
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.