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. COM
  4. CoInitialize return code

CoInitialize return code

Scheduled Pinned Locked Moved COM
comarchitecturequestion
3 Posts 2 Posters 1 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
    alex__b
    wrote on last edited by
    #1

    Hello I have this program which uses a COM DLL. On one computer all works fine. On another machine, coinitialize keeps returning 3 and fails. Anybody seen this return code before? Thanks

    alex 'Architecture is music frozen in space.'

    S 1 Reply Last reply
    0
    • A alex__b

      Hello I have this program which uses a COM DLL. On one computer all works fine. On another machine, coinitialize keeps returning 3 and fails. Anybody seen this return code before? Thanks

      alex 'Architecture is music frozen in space.'

      S Offline
      S Offline
      Sauro Viti
      wrote on last edited by
      #2

      Are you sure about the returned HRESULT? According to the CoInitialize Function (COM)[^], the possible results could be the ones below (see A lot of HRESULT codes...[^] for their numeric values):

      • E_INVALIDARG = 0x80070057 = -2147024809
      • E_OUTOFMEMORY = 0x8007000E = -2147024882
      • E_UNEXPECTED = 0x8000FFFF = -2147418113
      • S_OK = 0x00000000 = 0
      • S_FALSE = 0x00000001 = 1
      • RPC_E_CHANGED_MODE = 0x80010106 = -2147417850

      Then it seems that 3 is not a possible result; not only, I was not able to find a description for it anyway, according to Interpreting HRESULT Values[^], such a value doesn't indicates a failure (because the most significant bit is not set). In your application are you testing for specific values or are you using the SUCCEEDED() macro? When using COM is preferable to always use that macro to distinguish between success and failure...

      modified on Friday, October 15, 2010 5:52 AM

      A 1 Reply Last reply
      0
      • S Sauro Viti

        Are you sure about the returned HRESULT? According to the CoInitialize Function (COM)[^], the possible results could be the ones below (see A lot of HRESULT codes...[^] for their numeric values):

        • E_INVALIDARG = 0x80070057 = -2147024809
        • E_OUTOFMEMORY = 0x8007000E = -2147024882
        • E_UNEXPECTED = 0x8000FFFF = -2147418113
        • S_OK = 0x00000000 = 0
        • S_FALSE = 0x00000001 = 1
        • RPC_E_CHANGED_MODE = 0x80010106 = -2147417850

        Then it seems that 3 is not a possible result; not only, I was not able to find a description for it anyway, according to Interpreting HRESULT Values[^], such a value doesn't indicates a failure (because the most significant bit is not set). In your application are you testing for specific values or are you using the SUCCEEDED() macro? When using COM is preferable to always use that macro to distinguish between success and failure...

        modified on Friday, October 15, 2010 5:52 AM

        A Offline
        A Offline
        alex__b
        wrote on last edited by
        #3

        I know that and I haven't been able to find this code either. 3 is supposed to be a success code (bit 0 == 0), but apparently it is not. I am using SUCCEEDED, but the program kept failing further down the line, so I ran it thru the debugger and this is the HRESULT CoInitialize() returns.

        alex 'Architecture is music frozen in space.'

        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