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. Application crashes when CoCreateInstance is called in VS 2005 in Vista machine

Application crashes when CoCreateInstance is called in VS 2005 in Vista machine

Scheduled Pinned Locked Moved COM
visual-studiohelpquestionannouncement
2 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.
  • S Offline
    S Offline
    sw thi
    wrote on last edited by
    #1

    Here is the code that causes problem: CComPtr m_pMyComp; IUnknown* pUnkOuter = GetControllingUnknown(); HRESULT hRes = CoCreateInstance(CLSID_MyComp, pUnkOuter, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pMyComp.p); if (hRes != S_OK) return hRes; This code was ported from VS2003, it works in VS2003 but it crashes only in VS 2005 release mode. Any idea where the problem is??

    H 1 Reply Last reply
    0
    • S sw thi

      Here is the code that causes problem: CComPtr m_pMyComp; IUnknown* pUnkOuter = GetControllingUnknown(); HRESULT hRes = CoCreateInstance(CLSID_MyComp, pUnkOuter, CLSCTX_INPROC_SERVER, IID_IUnknown, (void**)&m_pMyComp.p); if (hRes != S_OK) return hRes; This code was ported from VS2003, it works in VS2003 but it crashes only in VS 2005 release mode. Any idea where the problem is??

      H Offline
      H Offline
      Hubert Mayer
      wrote on last edited by
      #2

      What is the HRESULT ? Check additionally with the "dependency walker" whether all dependent dlls are available

      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