473,659 Members | 2,626 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 1579
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**********@h otmail.comwrote in message
news:11******** *************@q 19g2000prn.goog legroups.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.comwrot e in message
news:un******** ******@TK2MSFTN GP03.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**********@h otmail.comwrote in message
news:11******** *************@q 19g2000prn.goog legroups.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...permanen tly.
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*********@gm ail.comwrote in message
news:11******** **************@ i38g2000prf.goo glegroups.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
3087
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, piece types, squares, etc.). To accomplish this, I used implicit conversions. For instance, a color used to be: typedef int Color; // and a few constants... Now a color is (paraphrased):
5
3029
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 templatized conversion operator defined as follows:
7
3256
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 I couldn't find the exact rule in the C++ standard. And what if the classes have template parameters? It would be great if somebody could get me a rough hint where in the
26
3799
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 lead to a lot of use of the database and the adding of quite a lot of new data (though I can't conceive of them adding more than than 10s of thousands of records, which won't change the current performance profile at all). If there is a SQL...
31
6618
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 variable becomes 364 and the other one becomes 365. Does anyone have any insight to what the problem is? Thanks in advance. Bjørn
4
6482
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? Thanks in advance... -Nikhil
2
6865
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 static explicit System.IntPtr (long);
47
2853
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 used and why ? Thanx
1
2162
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 char*:" << str << '\n'; } void print(int x)
21
2442
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 type is not a single identifier or keyword. Which one is correct? For example: unsigned long x = unsigned long(y); REH
0
8851
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
8751
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
8535
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
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
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
5650
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
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.