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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. COM
  4. Difference !!!

Difference !!!

Scheduled Pinned Locked Moved COM
game-devquestionhtmldatabasecom
4 Posts 4 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.
  • H Offline
    H Offline
    Hadi Rezaee
    wrote on last edited by
    #1

    Hi all, What is difference between E_FAIL and S_FALSE ??? Thanks for helps ... My month article: Game programming by DirectX by Lan Mader. Please visit in: www.geocities.com/hadi_rezaie/index.html Hadi Rezaie

    L 1 Reply Last reply
    0
    • H Hadi Rezaee

      Hi all, What is difference between E_FAIL and S_FALSE ??? Thanks for helps ... My month article: Game programming by DirectX by Lan Mader. Please visit in: www.geocities.com/hadi_rezaie/index.html Hadi Rezaie

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      E_FAIL (0x80004005) indicates, that the function fails. No further processing is possible (e.g. an object cannot be instanciated). Script languages are throwing exceptions in this case. S_FALSE (0x00000001) indicates, that the function has no effect or has no results. In script languages no exception will occur. Volker

      N 1 Reply Last reply
      0
      • L Lost User

        E_FAIL (0x80004005) indicates, that the function fails. No further processing is possible (e.g. an object cannot be instanciated). Script languages are throwing exceptions in this case. S_FALSE (0x00000001) indicates, that the function has no effect or has no results. In script languages no exception will occur. Volker

        N Offline
        N Offline
        Not Active
        wrote on last edited by
        #3

        These can also be used to inform of fatal and non-fatal errors. S_FALSE may be returned from a method when it partially succeeded. For example numbers were calculated correctly but were of insufficient range. HRESULT Calculate(int x, int y) { if( x > 5000 || y > 5000) return E_FAIL; // return failure because these numbers are greater than // possible range expected if( (x + y) < 500 ) return S_FALSE; // return false because it worked but just wasn't high enough else return S_OK; }

        B 1 Reply Last reply
        0
        • N Not Active

          These can also be used to inform of fatal and non-fatal errors. S_FALSE may be returned from a method when it partially succeeded. For example numbers were calculated correctly but were of insufficient range. HRESULT Calculate(int x, int y) { if( x > 5000 || y > 5000) return E_FAIL; // return failure because these numbers are greater than // possible range expected if( (x + y) < 500 ) return S_FALSE; // return false because it worked but just wasn't high enough else return S_OK; }

          B Offline
          B Offline
          Ben M Stokland
          wrote on last edited by
          #4

          E_FAIL will also throw an exception if you use Visual Basic, and S_FALSE will not.

          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