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. Is there something wrong with my DirectX SDK?

Is there something wrong with my DirectX SDK?

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++asp-netvisual-studiographics
1 Posts 1 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.
  • R Offline
    R Offline
    Redeemer dk
    wrote on last edited by
    #1

    When i try to use the RenderFile function on an IGraphBuilder i get a ton of errors. I've also tried downloading a sample file that is guaranteed to work, but i still get the errors. Here's the code from the sample:

    #include <windows.h>
    #include <objbase.h>
    #include <dShow.h>

    int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    {
    HRESULT hr;
    IGraphBuilder* pGraphBuilder;
    IMediaControl* pMediaControl;
    WCHAR MediaFile[MAX_PATH];

    CoInitialize(NULL);
    
    hr = CoCreateInstance(CLSID\_FilterGraph, NULL, CLSCTX\_ALL, IID\_IGraphBuilder, (void\*\*)&pGraphBuilder);
    if (FAILED(hr))
    	return -1;
    
    MultiByteToWideChar(CP\_ACP, 0, lpCmdLine, -1, MediaFile, MAX\_PATH);
    hr = pGraphBuilder->RenderFile(MediaFile, NULL);
    if (FAILED(hr))
    	return -2;
    
    hr = pGraphBuilder->QueryInterface(IID\_IMediaControl, (void\*\*)&pMediaControl);
    if (FAILED(hr))
    	return -3;
    
    hr = pMediaControl->Run();
    if (FAILED(hr))
    	return -4;
    
    Sleep(10000);
    
    pMediaControl->Stop();
    pMediaControl->Release();
    pGraphBuilder->Release();
    
    CoUninitialize();
    
    return 0;
    

    }

    I set up VS .NET so the commandline contains a valid media file. When it performs the RenderFile function it loads in a sec or so and comes with a bunch of erros like these:

    ASSERT failed.
    g_cFGObjects == 0
    At line 6002 d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\filgraph.cpp
    Continue? (Cancel to debug)

    ASSERT failed.
    Executable: DShowTut1.exe Pid 720 Tid 2cc. Module quartz.dll, 26 objects left active!
    At line 317 of d:\xpclient\multimedia\published\dxmdev\dshowdev\base\dllentry.cpp
    Continue? (Cancel to debug)

    sometimes it also pops up with additional erros like:

    m_dwRecursionCount == 0 && m_dwOwnerThreadId == 0
    At line 58 of d:\xpclient\multimedia\dshow\filters\core\filgraph\filgraph\msgmutex.cpp
    Continue? (Cancel to Debug)

    And then exits. Anyone know what could be wrong? Thanks all! -Rune Svendsen

    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