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

    Proper way of invoking API

    Hi!
    In some source codes, I have seen API used like this:
    SendMessage(rtfText.hwnd, EM_GETMODIFY, 0&, 0&)


    What is "&" doing here? I mean if I remove he "&" sign
    code still works.
    SendMessage(rtfText.hwnd, EM_GETMODIFY, 0, 0)


    Is there any difference?


  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Proper way of invoking API

    The ampersand(&) indicates the datatype of LONG.
    a Percent (%) indicates an INteger
    a Dollar Sign ($) indicates string
    etc. It is a throw back to old DOS programming where you define datatypes by symbol instead of a word.
    Some of the old line programmers still use it as well as functions that have been around for eons that still work.
    In the case of 0&, it means Zero value. If this were a variable such as myLong& then removing the & would have unpredictable and undesired effects.

    John G

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