PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Newbie Converting vb6 CLS file to Class File
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Newbie Converting vb6 CLS file to Class File
![]() |
Newbie Converting vb6 CLS file to Class File |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I have an onld VB6 DLL with many classes defined in *.cls files. I like to convert them to VB.Net. I have a couple of questions 1) Get/Set is not supported in VB.Net how do I convert this code so VB.Net does not come up with error Class MyAppClass Public Property Get UserId() As Long UserId = intUserId End Property Public Property Let UserId(ByVal pUserId As Long) intUserId = pUserId End Property End Class 2) Can I use the "cls" file extension or should I change it to "VB" extension 3)Is there a VB6 to VB.Net translator? Thanks |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Have you tried opening the VB6 project file in VB.NET yet?
There is a conversion wizzard that should do the basics to bring it over. "Mo" <le_mo_mo@yahoo.com> wrote in message news:1182816819.023130.16880@p77g2000hsh.googlegroups.com... > Hi, > > I have an onld VB6 DLL with many classes defined in *.cls files. I > like to convert them to VB.Net. I have a couple of questions > 1) Get/Set is not supported in VB.Net how do I convert this code so > VB.Net does not come up with error > > Class MyAppClass > > Public Property Get UserId() As Long > UserId = intUserId > End Property > > Public Property Let UserId(ByVal pUserId As Long) > intUserId = pUserId > End Property > > End Class > > 2) Can I use the "cls" file extension or should I change it to "VB" > extension > 3)Is there a VB6 to VB.Net translator? > > Thanks > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Mo wrote:
> 1) Get/Set is not supported in VB.Net how do I convert this code so > VB.Net does not come up with error Public Property UserId() As Integer Get Return intUserId End Get Set( Value as Integer ) intUserId = Value End Set End Property Well done, BTW, for spotting the change from Long to Integer. > 2) Can I use the "cls" file extension or should I change it to "VB" > extension Change it to .vb, otherwise the IDE won't recognise it and will probably try to upgrade what it /thinks/ is VB "Proper" code into VB.Net, but it's already VB.Net code, so it'll get into an even /bigger/ muddle than usual. > 3)Is there a VB6 to VB.Net translator? Yes, the VB IDE. Just open the .cls file and it will /try/ to upgrade it. IMHO, it doesn't make a very good job of it and, even if it does manage to produce something that compiles, the code it produces is unlikely to be anything like the code you'd write from scratch. HTH, Phill W. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Thank you Phil, Just the information I needed. One more question I
have. I have whole bunch of *.cls class files and one xxx.bas file. How do I create a new VB6 project to create a dll file from these files called mydll.dll? Any pointer on how to go about it? I inherited this old application and I am not sure how to recreate the original solution. Thanks |
|
|
|
#5 |
|
Guest
Posts: n/a
|
"Mo" <le_mo_mo@yahoo.com> schrieb
> Thank you Phil, Just the information I needed. One more question I > have. I have whole bunch of *.cls class files and one xxx.bas file. > How do I create a new VB6 project to create a dll file from these > files called mydll.dll? Any pointer on how to go about it? I > inherited this old application and I am not sure how to recreate the > original solution. The classes must have been part of a VB6 project. If you don't have a running and compilable VB6 project, it's hard or even impossible for the VB.Net upgrade wizard to migrate the project. So, don't you have a VB6 project (.vbp file)? Armin |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

