CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2003
    Posts
    125

    Unhappy converting between VB6 and VB .NET

    Hi,

    I have installed Visual Studio .NET and i want to build a VB project, the problem i encountred is :

    i couldn't use the Variant type and every Variant is changed by Object, this type object causes errors when executing...
    how can i use the same type or use a similar type a variant.



  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Well that is one of the big changes in VB.NET. No more slow and un-optimized VARIANT type. Remember that all .NET languages must conform to the .NET data types and VARIANT is not one of them.

    You basically have to change all VARIANT type to OBJECT and then use CTYPE() or DIRECTCAST() functions to convert them to the right TYPE when you need to use it. .NET is STRONGLY TYPED.

    -Cool Bizs

  3. #3
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    If you're using a lot a variant data types the code should/could be re-writen using "real" types. This will improve performance, stability, readability and maintainability. Variants always have been a "bad practice".

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

Featured