CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Define

  1. #1
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    Define

    Is there anything in Visual Basic equal with its behaviour or functionality to C++ #define ???
    If so what is it and how do I use it. same as in C++ ??

    FatMan


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Define


    #define WM_MYMSG 0x30




    is


    public Conts WM_MYMSG = &H30




    Is this what you mean?

    HTH,
    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Define


    #define WM_MYMSG 0x30




    is


    public Const WM_MYMSG = &H30




    Is this what you mean?

    HTH,
    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  4. #4
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    Re: Define

    I mean for example:

    #define _VB_APPLICATION_

    ...

    #ifdef _VB_APPLICATION_
    ...
    #else
    ...
    #endif

    I mean defining flags for the compiler. and not just defining some constant object.

    FatMan


  5. #5
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Define

    Absolutely - use:

    #IF VB_APPLICATION = 1 then

    #else

    #End IF




    And then set the compiler option in the "Conditional compiler options" text box on the "Make" tab on the project properties screen.

    HTH,
    D.

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

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