INFO: The RenderFile Method Does Not Work for GraphEdit (.grf) Files (313844)



The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK) 1.0

This article was previously published under Q313844

SUMMARY

If you use the IGraphBuilder::RenderFile method to open a GraphEdit (.grf) file, error 0x80040265 may be returned.

MORE INFORMATION

Starting with Microsoft DirectX version 8.1, programs cannot use the IGraphBuilder::RenderFile method to open .grf files. This change was made because of program interoperability issues.

You can open GraphEdit files by using the GraphEdit utility, or by using the IStream interface. The following sample code demonstrates how to use the IStream interface:
HRESULT LoadGraphFile(IGraphBuilder *pGraph, const WCHAR* wszName)
{
    IStorage *pStorage = 0;

    if (S_OK != StgIsStorageFile(wszName))
    {
        return E_FAIL;
    }

    HRESULT hr = StgOpenStorage(wszName, 0, 
        STGM_TRANSACTED | STGM_READ | STGM_SHARE_DENY_WRITE, 0, 0, &pStorage);

    if (FAILED(hr))
    {
        return hr;
    }

    IPersistStream *pPersistStream = 0;
    hr = pGraph->QueryInterface(IID_IPersistStream, reinterpret_cast<void**>(&pPersistStream));

    if (SUCCEEDED(hr))
    {
        IStream *pStream = 0;
        pStorage->OpenStream(L"ActiveMovieGraph", 0, 
            STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &pStream);

        if(SUCCEEDED(hr))
        {
            hr = pPersistStream->Load(pStream);
            pStream->Release();
        }
        pPersistStream->Release();
    }
    pStorage->Release();
    return hr;
}
				
Note that .grf files are meant for testing and debugging. They are not meant for end-user programs.

Modification Type:MinorLast Reviewed:7/11/2005
Keywords:kbDSWMM2003Swept kbinfo KB313844