none
DsoFramer用于大文档的问题 RRS feed

  • 常规讨论

  • 当打开一个1M左右的文档时, 以下程序中GetData返回“E_OUTOFMEMORY“,请问各路专家是否意味着DsoFramer.ocx或剪贴板有文件大小方面的限制?谢谢!

    STDMETHODIMP CDsoDocObject::HrGetDataFromObject(VARIANT *pvtType, VARIANT *pvtOutput)
    {
        .......
        // We take the name and find the right clipformat for the data type...
        pwszTypeName = LPWSTR_FROM_VARIANT(*pvtType);
        if ((pwszTypeName) && (pszFormatName = DsoConvertToMBCS(pwszTypeName)))
        {
            cfType = RegisterClipboardFormat(pszFormatName);
            DsoMemFree(pszFormatName);
        }
        else cfType = LONG_FROM_VARIANT(*pvtType, 0);
        CHECK_NULL_RETURN(cfType, E_INVALIDARG);
    
     // We must be able to get IDataObject for the transfer to work...
        if ((m_pole == NULL) || 
            (FAILED(m_pole->GetClipboardData(0, (IDataObject**)&pdo)) && 
             FAILED(m_pole->QueryInterface(IID_IDataObject, (void**)&pdo))))
             return OLE_E_CANT_GETMONIKER;
    
        ASSERT(pdo); CHECK_NULL_RETURN(pdo, E_UNEXPECTED);
    
     // We are going to ask for HGLOBAL data format only. This is majority 
     // of the non-binary formats, which should be sufficient here...
        memset(&ftc, 0, sizeof(ftc));
        ftc.cfFormat = (WORD)cfType;
        ftc.dwAspect = DVASPECT_CONTENT;
        ftc.lindex = -1; 
        ftc.tymed = TYMED_HGLOBAL;
    
        memset(&stgm, 0, sizeof(stgm));
        stgm.tymed = TYMED_HGLOBAL;
    
           // Ask the object for the data...
    	hr = ((CDsoFramerControl::XDataObject*)pdo)->QueryGetData(&ftc);
    	if(!SUCCEEDED(hr))
    	{
    		pdo->Release();
    		return hr;
    	} 
    	hr = ((CDsoFramerControl::XDataObject*)pdo)->GetData(&ftc, &stgm);
          ......
    }


    2018年6月1日 3:47