本文整理汇总了C++中CFileIO::GetColNameHeap方法的典型用法代码示例。如果您正苦于以下问题:C++ CFileIO::GetColNameHeap方法的具体用法?C++ CFileIO::GetColNameHeap怎么用?C++ CFileIO::GetColNameHeap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFileIO
的用法示例。
在下文中一共展示了CFileIO::GetColNameHeap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sizeof
// CImpIColumnsInfo::GetColumnInfo -------------------------------------------
//
// @mfunc Returns the column metadata needed by most consumers.
//
// @rdesc HRESULT
// @flag S_OK | The method succeeded
// @flag E_OUTOFMEMORY | Out of memory
// @flag E_INVALIDARG | pcColumns or prginfo or ppStringsbuffer was NULL
//
STDMETHODIMP CImpIColumnsInfo::GetColumnInfo
(
DBORDINAL* pcColumns, //@parm OUT | Number of columns in rowset
DBCOLUMNINFO** prgInfo, //@parm OUT | Array of DBCOLUMNINFO Structures
WCHAR** ppStringsBuffer //@parm OUT | Storage for all string values
)
{
HRESULT hr = S_OK;
DBORDINAL cCols = 0;
DBORDINAL cExtraCols = 0;
DBORDINAL cbHeapUsed = 0;
DBORDINAL cIter = 0;
BYTE * pbHeap = NULL;
WCHAR * pwstrBuffer = NULL;
DBCOLUMNINFO * rgdbcolinfo = NULL;
DBCOLUMNINFO * rgdbInternalcolinfo = NULL;
DBCOLUMNINFO * rgdbExtracolinfo = NULL;
CRowset * pCRowset = NULL;
CFileIO * pFileio = NULL;
//
// Asserts
//
assert(m_pObj);
//
// Check in-params and NULL out-params in case of error
//
if( pcColumns )
*pcColumns = 0;
if( prgInfo )
*prgInfo = NULL;
if( ppStringsBuffer )
*ppStringsBuffer = NULL;
if( !pcColumns || !prgInfo || !ppStringsBuffer )
return E_INVALIDARG;
//
// Get the Column Information off of the Command or Rowset
//
if( m_pObj->GetBaseObjectType() == BOT_COMMAND )
{
//
// Asserts
//
assert(((CCommand *) m_pObj)->m_pCSession);
assert(((CCommand *) m_pObj)->m_pCSession->m_pCDataSource);
//
// Check that a command has been set
//
if( !((CCommand *) m_pObj)->IsCommandSet() )
return DB_E_NOCOMMAND;
//
// Try to open the file...
//
hr = ((CCommand *) m_pObj)->m_pCSession->m_pCDataSource->OpenFile(
((CCommand *) m_pObj)->GetCommandText(), &pFileio);
if( FAILED(hr) )
return hr;
}
else
{
if( m_pObj->GetBaseObjectType() == BOT_ROWSET )
pFileio = ((CRowset *) m_pObj)->GetFileObj();
else
{
pFileio = ((CRow *) m_pObj)->GetFileObj();
cExtraCols = ((CRow *) m_pObj)->GetExtraColCount();
rgdbExtracolinfo = ((CRow *) m_pObj)->GetExtraColumnInfo();
}
}
//
// Get the column count and delete unneeded info
//
cCols = pFileio->GetColumnCnt();
pbHeap = pFileio->GetColNameHeap();
cbHeapUsed = pFileio->GetColNameHeapSize();
rgdbInternalcolinfo = pFileio->GetColInfo();
//
// Return the column information
//
SAFE_ALLOC(rgdbcolinfo, DBCOLUMNINFO, (cCols + cExtraCols) * sizeof(DBCOLUMNINFO));
SAFE_ALLOC(pwstrBuffer, WCHAR, cbHeapUsed);
//.........这里部分代码省略.........