Converting VB6 to VB.NET without a full VB6 project
Hi,
Is there a way to use the VB6 to VB.NET conversion program if you don't have
a full original VB6 project. The program only seems to work on projects, but
I only have a single (but complete) source file.
Why? Well, I have some sample VB6 code (and some VBA code) which I want to
convert to VB.NET, but I no longer have VB6 to stuff it all in a project.
I'm having a dang-diddly-doo of a time trying to find the magic incantation
for some unique parts of the VB6 code. (Full thanks to Ned Flanders for
helping curb my public use of profanity ;-)
For example, I have the following VB6 type definition (a random-access file
record):
Private Type EMasterHeaderRawRecType
ContainerId(1) As Byte ' converted to a 16 bit unsigned integer
JobCodes(1) As Byte
JobTitle As String * 30
Reserved(19) as Byte
...
End Type
Here's my first .NET conversion effort:
Public Structure ContainerJob
Public ContainerId As UInt16 ' Nope, FileOpen() doesn't like
UInt16 (of course)
Public JobCodes(2) As Byte ' Nope, can't have dimensioned
arrays in structures
<VBFixedString(30)> Public JobTitle As String
Public Reserved(20) As Byte ' Nope, ditto
...
End Structure
Which led me to the inelegant, unwieldy beast:
Public Structure ContainerJob
Public ContainerId1 As Byte
Public ContainerId2 As Byte
Public JobCodes1 As Byte
Public JobCodes2 As Byte
<VBFixedString(30)> Public JobTitle As String
<VBFixedString(20)> Public ReservedFiller As String
... ' and it gets even worse for other fields
End Structure
Which FileGetObject() doesn't seem to like much, but that's another story.
Any and all help is greatly appreciated.
Thanks!
PS. Can I, for example, doctor up the VB6 project header file some how?