locked
How to implement typedef in VB 2010? RRS feed

  • Question

  • User430644775 posted

    hi,

    Can anyone help me with a way to implement typedef in vb2010, because I see it helpfull way to define types.

    Thursday, April 22, 2010 2:17 AM

Answers

  • User2130758966 posted

    There isn't really an equivalent. In .net you generally just make a class or a struct to hold your custom data types.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 5:02 AM
  • User397347636 posted

    Yes - you can use 'Import aliases' for this:

    For example,

    Imports Foo = System.Windows.Forms.Form

    is equivalent to the following C++ typedef:

    typedef System::Windows::Forms::Form Foo; 

    e.g., you can now use "Foo" rather than "System.Windows.Forms.Form" throughout the file.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 10:14 AM

All replies

  • User2130758966 posted

    There isn't really an equivalent. In .net you generally just make a class or a struct to hold your custom data types.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 5:02 AM
  • User397347636 posted

    Yes - you can use 'Import aliases' for this:

    For example,

    Imports Foo = System.Windows.Forms.Form

    is equivalent to the following C++ typedef:

    typedef System::Windows::Forms::Form Foo; 

    e.g., you can now use "Foo" rather than "System.Windows.Forms.Form" throughout the file.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, April 22, 2010 10:14 AM