Click to See Complete Forum and Search --> : Fata error related to file permission


Ashmon
July 24th, 2007, 11:09 AM
Hello all,

I took some sample code from the msdn website which plays back a video file. I try to compile the file and i get the folowing error:

VideoStreaming fatal error C1084: Cannot read include file: 'c:\program files\microsoft visual studio .net 2003\vc7\platformsdk\include\edevdefs.h': Permission denied

Below is the code and the environment i'm using:

#include <Dshow.h>
void main(void)
{
IGraphBuilder *pGraph = NULL;
IMediaControl *pControl = NULL;
IMediaEvent *pEvent = NULL;

// Initialize the COM library.
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
{
printf("ERROR - Could not initialize COM library");
return;
}

// Create the filter graph manager and query for interfaces.
hr = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
if (FAILED(hr))
{
printf("ERROR - Could not create the Filter Graph Manager.");
return;
}

hr = pGraph->QueryInterface(IID_IMediaControl, (void **)&pControl);
hr = pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);

// Build the graph. IMPORTANT: Change this string to a file on your system.
hr = pGraph->RenderFile(L"C:\\Movies\Dreamgirls\Dreamgirls (2006).avi", NULL);
if (SUCCEEDED(hr))
{
// Run the graph.
hr = pControl->Run();
if (SUCCEEDED(hr))
{
// Wait for completion.
long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);

// Note: Do not use INFINITE in a real application, because it
// can block indefinitely.
}
}
pControl->Release();
pEvent->Release();
pGraph->Release();
CoUninitialize();
}


Environment: Win XP SP2, DirectX (June 2007), .Net 2003, Framework 1.1

Any help would be appreciated.

Thanks,

Ashmon

MrViggy
July 24th, 2007, 12:01 PM
Does the specified include file exist? Do you have read permission for the file (can you open the file in a text editor)?

Viggy

Ashmon
July 24th, 2007, 12:38 PM
The file exists but I can't open it. It tells me an unexpected error occured while trying to read the file with wordpad or notepad. I can't open the file with Visual.NET sdk either.

Maybe the file is corrupted or it's a file critical to system functionality so access is denied ?

Thanks,

Ashmon

MrViggy
July 25th, 2007, 11:26 AM
It's a header file, so I doubt it's critical to system functionality (it doesn't have any executable code in it). Most likely, it's corrupt. Try re-installing the SDK.

Viggy

Ashmon
July 25th, 2007, 11:29 AM
You are absolutely right. The file was corrupt. I fixed the issue and I don't get the fatal error anymore.

Thx for the help everybody,

Ashmon