下面是程序源码 IStream* stream;
HGLOBAL hGlob;
hGlob = GlobalAlloc( GMEM_FIXED , entry.nDataSize);  BYTE *ret = new BYTE[entry.nDataSize];
//读出旧位图
if(pStm)pStm->Read((BYTE*)hGlob, entry.nDataSize, NULL);
outPak->EndFile();
 

CreateStreamOnHGlobal(hGlob, TRUE, &stream);编译的时候在最后一句的时候提示:
error C2664: 'CreateStreamOnHGlobal' : cannot convert parameter 3 from 'struct XStream *' to 'struct IStream ** '请各位帮忙

解决方案 »

  1.   

    补充:提示没写完,完整的为:error C2664: 'CreateStreamOnHGlobal' : cannot convert parameter 3 from 'struct XStream *' to 'struct IStream ** '
            Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
      

  2.   

    你是不是用了什么跟XStream有关的库?
    这样写试试::CreateStreamOnHGlobal(hGlob, TRUE, &stream); 
      

  3.   

    奇怪了,
    这样的代码在我这里直接编译通过struct 
    {
    int nDataSize;
    }entry;
    int _tmain(int argc, _TCHAR* argv[])
    {
    IStream* stream; 
    HGLOBAL hGlob; 
    hGlob = GlobalAlloc( GMEM_FIXED , entry.nDataSize); 
    CreateStreamOnHGlobal(hGlob, TRUE, &stream); 
    return 0;
    }
      

  4.   

    看来你这个IStream不是真正的IStream。