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. CoCreateInstance

CoCreateInstance

Scheduled Pinned Locked Moved C / C++ / MFC
questioncomtestingbeta-testinghelp
5 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.
  • H Offline
    H Offline
    hmaturana
    wrote on last edited by
    #1

    I'm testing a DirectShow Filter I'm including this code to initialize an COM object hr = CoCreateInstance(CLSID_MPEGFilter, NULL, CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void **)&m_pMPEGWriter); I have included the header in my application so it compile ok. But I get a link error error LNK2001: unresolved external symbol CLSID_MPEGFilter - How can I know if the object has been registered? - I don't see any .lib to include just couple of DLL Any idea what I can be doing wrong? :doh: Thak You Hector

    D B 2 Replies Last reply
    0
    • H hmaturana

      I'm testing a DirectShow Filter I'm including this code to initialize an COM object hr = CoCreateInstance(CLSID_MPEGFilter, NULL, CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void **)&m_pMPEGWriter); I have included the header in my application so it compile ok. But I get a link error error LNK2001: unresolved external symbol CLSID_MPEGFilter - How can I know if the object has been registered? - I don't see any .lib to include just couple of DLL Any idea what I can be doing wrong? :doh: Thak You Hector

      D Offline
      D Offline
      Dudi Avramov
      wrote on last edited by
      #2

      In the Debug Watch window type "hr,hr" and you will see the description of error. Nevertheless, don't forget to call CoInitialize(NULL); Dudi

      H 1 Reply Last reply
      0
      • D Dudi Avramov

        In the Debug Watch window type "hr,hr" and you will see the description of error. Nevertheless, don't forget to call CoInitialize(NULL); Dudi

        H Offline
        H Offline
        hmaturana
        wrote on last edited by
        #3

        I can not go to de Debug Window at least I have an executable so I have to fix the link error first. Am I correct?

        D 1 Reply Last reply
        0
        • H hmaturana

          I can not go to de Debug Window at least I have an executable so I have to fix the link error first. Am I correct?

          D Offline
          D Offline
          Dudi Avramov
          wrote on last edited by
          #4

          I think that you didn't understand me. CoCreateInstance returns HRESULT. you defined hr variable as HRESULT. Typing "hr,hr" in the Debug Watch window shows the error description.

          1 Reply Last reply
          0
          • H hmaturana

            I'm testing a DirectShow Filter I'm including this code to initialize an COM object hr = CoCreateInstance(CLSID_MPEGFilter, NULL, CLSCTX_INPROC_SERVER,IID_IBaseFilter, (void **)&m_pMPEGWriter); I have included the header in my application so it compile ok. But I get a link error error LNK2001: unresolved external symbol CLSID_MPEGFilter - How can I know if the object has been registered? - I don't see any .lib to include just couple of DLL Any idea what I can be doing wrong? :doh: Thak You Hector

            B Offline
            B Offline
            Blake Miller
            wrote on last edited by
            #5

            Maybe if you use the #pragma import directove on the DLL that has the MPEG filter class object in it, then your unresolved external will go away. No shirt, no shoes, no brains, no service.

            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