Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. why 3rd parameter change to char?

why 3rd parameter change to char?

Scheduled Pinned Locked Moved ATL / WTL / STL
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alan top
    wrote on last edited by
    #1

    this is idl declaration: STDMETHOD(ExecVerifygps)(/*[in]*/ BSTR gpsContent, /*[in]*/ short length, /*[out, retval]*/ boolean* flag); this build tli file. inline char IVgps::ExecVerifygps ( _bstr_t gpsContent, short length ) { char _result; HRESULT _hr = raw_ExecVerifygps(gpsContent, length, &_result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _result; } why 3rd parameter change to char?

    alantop

    S L 2 Replies Last reply
    0
    • A alan top

      this is idl declaration: STDMETHOD(ExecVerifygps)(/*[in]*/ BSTR gpsContent, /*[in]*/ short length, /*[out, retval]*/ boolean* flag); this build tli file. inline char IVgps::ExecVerifygps ( _bstr_t gpsContent, short length ) { char _result; HRESULT _hr = raw_ExecVerifygps(gpsContent, length, &_result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _result; } why 3rd parameter change to char?

      alantop

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      C doesn't have a native boolean type (as used in the IDL), so you need to use some other type that's the same size as boolean. An IDL boolean is 8 bits, as is a C char. It would have looked better to use typedef char boolean;, 'cause then you could use boolean in the code.

      1 Reply Last reply
      0
      • A alan top

        this is idl declaration: STDMETHOD(ExecVerifygps)(/*[in]*/ BSTR gpsContent, /*[in]*/ short length, /*[out, retval]*/ boolean* flag); this build tli file. inline char IVgps::ExecVerifygps ( _bstr_t gpsContent, short length ) { char _result; HRESULT _hr = raw_ExecVerifygps(gpsContent, length, &_result); if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this)); return _result; } why 3rd parameter change to char?

        alantop

        L Offline
        L Offline
        lafleon
        wrote on last edited by
        #3

        Hello, Did you try VARIANT_BOOL? Regards, Leonid

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups