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. C / C++ / MFC
  4. COM errors

COM errors

Scheduled Pinned Locked Moved C / C++ / MFC
comhelpquestion
3 Posts 2 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.
  • P Offline
    P Offline
    Prakash Nadar
    wrote on last edited by
    #1

    i am using third party COM component... I have put them in try catch block for any com error.. by using _com_error i am able to retrive the error code and error message... But i want to filter out some of the error code say 0x80004005 (unexpected error). When this error occurs i just handle the error gracefully without notifying the user of the actual cause. My question is.. Is there any #define for 0x80004005 like #define COM_UNEXPECTED 0x80004005 so that i can use it in my switch case like switch(ce.Error()) { case COM_UNEXPECTED: .... default: ... } now my switch looks like this switch(ce.Error()) { case 0x80004005: .... default: ... } I know that i can #define it myself but i looking for the one that is already defined. Thank You. My God is more powerfull Than Your God. (the line that divides the world)

    A 1 Reply Last reply
    0
    • P Prakash Nadar

      i am using third party COM component... I have put them in try catch block for any com error.. by using _com_error i am able to retrive the error code and error message... But i want to filter out some of the error code say 0x80004005 (unexpected error). When this error occurs i just handle the error gracefully without notifying the user of the actual cause. My question is.. Is there any #define for 0x80004005 like #define COM_UNEXPECTED 0x80004005 so that i can use it in my switch case like switch(ce.Error()) { case COM_UNEXPECTED: .... default: ... } now my switch looks like this switch(ce.Error()) { case 0x80004005: .... default: ... } I know that i can #define it myself but i looking for the one that is already defined. Thank You. My God is more powerfull Than Your God. (the line that divides the world)

      A Offline
      A Offline
      Abhishek Srivastava
      wrote on last edited by
      #2

      Hi Mr Prakash! actually yes, u dont need to make one more #define as one already exist there /**** MessageId: E_FAIL MessageText: Unspecified error #define E_FAIL _HRESULT_TYPEDEF_(0x80004005L) ***/ so instead of using that not so gud luking figure 0x80004005 u can smiply use better luking "E_FAIL" for this purpose :) I hope ur prob is solved :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

      P 1 Reply Last reply
      0
      • A Abhishek Srivastava

        Hi Mr Prakash! actually yes, u dont need to make one more #define as one already exist there /**** MessageId: E_FAIL MessageText: Unspecified error #define E_FAIL _HRESULT_TYPEDEF_(0x80004005L) ***/ so instead of using that not so gud luking figure 0x80004005 u can smiply use better luking "E_FAIL" for this purpose :) I hope ur prob is solved :) Abhishek Srivastava Software Engineer (VC++) India ,Noida Mobile no 9891492921 :)

        P Offline
        P Offline
        Prakash Nadar
        wrote on last edited by
        #3

        Yeah you solved my prob, thanx a lot. My God is more powerfull Than Your God. (the line that divides the world)

        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