What's wrong with the c++ code below?
HRESULT SaveGraphFile(IGraphBuilder *pGraph, WCHAR *wszPath)
{
const WCHAR wszS开发者_高级运维treamName[] = 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 ?
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.
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.
精彩评论