本帖最后由 shn521 于 2011-11-12 10:25:36 编辑

解决方案 »

  1.   

    char *pBuf = NULL;
    SafeArrayAccessData(varBLOB.parray,(void **)&pBuf);
    memcpy(pBuffer,pBuf,nSize); ///复制数据到缓冲区m_pBMPBuffer
    SafeArrayUnaccessData (varBLOB.parray);
    m_Pic.LoadPictureData(pBuffer, nSize);
    delete [] pBuffer;free(pBuffer)就可以了吧。
      

  2.   

    pBuf=0; pBuf = NULL; NULL和0还是有区别的。
      

  3.   


    sorry,看错了,这个没问题的,不过pBuf你给它分配空间了吗? 有没怎么memcpy?
      

  4.   

    解决了,是OleLoadPicture(pStream, nSize, FALSE, IID_IPicture, (LPVOID *)&m_IPicture))中m_IPicture没有释放
      

  5.   

    FreeResource(hGlobal); 改为
    GlobalFree(hGlobal);
      

  6.   


     [out] Address of pointer variable that receives the interface pointer requested 
    in riid. Upon successful return, *ppvObj contains the requested interface 
    pointer on the storage of the object identified by the moniker. If *ppvObj is 
    non-NULL, this function calls IUnknown::AddRef on the interface; it is the 
    caller's responsibility to call IUnknown::Release. If an error occurs, *ppvObj 
    is set to NULL.