Results 1 to 4 of 4

Thread: [RESOLVED] Moving from VB6 to VB.NET 2010 - Need advice

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2009
    Posts
    93

    Resolved [RESOLVED] Moving from VB6 to VB.NET 2010 - Need advice

    Hi,
    A few years ago I created an application using VB6. It works fine on all OS but considering vb6 is no longer supported and it lacks lots of features, I’ve decided to upgrade to VB.NET. Plus I also want my software to run on all future OS correctly.

    I was using the ADODC control on many of my forms. In VB.NET, if I go to Tools > Choose Toolbox Items, I see ADODC under the “.NET framework components” tab. Can I still use this or is it outdated/no longer supported? If I use it, will my software work on 32bits and 64bits systems?

    Another thing, in vb6 I had this code:
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"(ByRef Destination As Any, ByRef Source As Any, ByVal Length As Integer)

    But in VB.NET when I write this I get the error “As Any” is not supported in “Declare” statements. How should I write this in VB.NET?

    Thank You,
    Krishley

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Moving from VB6 to VB.NET 2010 - Need advice

    You shouldn't have used and the ADODC control even in VB6. In .NET forget about connection controls and go with ADO.NET

    VB6 was very liberal with how you would allowed to declare variables. As you found out, VB.NET is a bit more strict, which is a good thing.

    This article might help specifically with Copy Memory: http://www.codeproject.com/KB/vb/CopyMemory_in_Net.aspx

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Apr 2009
    Posts
    93

    Re: Moving from VB6 to VB.NET 2010 - Need advice

    Hi Hack,
    Thanks for that quick reply! I checked the link ("upgrading vb6 code to VB.NET) in your signature and that will help a lot

    I've checked the CopyMemory link. Thanks. I have other declarations like this which include the "Any". Hope i'll be able to find all their VB.net equivalent.

    Thanks,
    Krishley

  4. #4
    New Member
    Join Date
    Sep 2011
    Posts
    3

    Re: Moving from VB6 to VB.NET 2010 - Need advice

    I had (still have) lots of VB6 tools for work.

    When I upgraded to 2010 I rewrote them; gave me the opportunity to rethink lots of bits, to drop lots of obsolete code, change the way some things were done. I did get a fair amount of change resistance from my users

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width