tags:

views:

112

answers:

2
HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath) 
{
    const WCHAR wszStreamName[] = L"ActiveMovieGraph"; 
    HRESULT hr;
    IStorage *pStorage = NULL;

    // First, create a document file that will hold the GRF file
    hr = StgCreateDocfile(
         wszPath,
         STGM_CREATE │ STGM_TRANSACTED │ STGM_READWRITE │ 
            STGM_SHARE_EXCLUSIVE,
         0, &pStorage);
    ....

I copied it somewhere,but the compiler is reporting:

syntax error : missing ')' before identifier '│'

Why is | regarded an identifier ?

+12  A: 

Your pipes aren't really pipes. The character between the STGM constants should be | (ASCII 124), but what you have is ¦ (ASCII 166, which isn't strictly speaking ASCII at all). It looks like you're the victim of a faulty copy-paste.

JSBangs
But the pipe in my question seems to be `|`(ascii 124), isn't it?
No. Pipe in your question: `│` vs. Ascii 124: `|`. Side by side: `│|`
Justin Ardini
Found what you used: Extended Ascii 179, according to http://www.codesascii.com/.
Justin Ardini
impressive find, @JSBangs
tenfour
Very impressive. Same kind of error as "int c = 0; с++".
SigTerm
A: 

I would try to remove the constants one by one until all pipes are gone or put the expression with the constants in a variable of its own and use that instead.