首页上一页 1 下一页尾页 1 条记录 1/1页
求助 vc项目开发实录 10 人力资源管理系统
发表在C语言图书答疑
2010-05-27
是否精华
是
否
版块置顶:
是
否
CADOOpration 类里的
BOOL CADOOperation::SetItemContent(CString field, DWORD type, const void *variable)
case ADO_TYPE_BITMAP_FIEL:
{
CString* lpStr = (CString*)variable;
VARIANT bitData = {0};
CFile file(*lpStr, CFile::modeRead);
DWORD fileSize = file.GetLength() + 1;
char* bitBuffer = new char[fileSize];
file.ReadHuge(bitBuffer, fileSize);
file.Close();
bitData.vt = VT_ARRAY | VT_UI1;
SAFEARRAY* pSafeArray;
SAFEARRAYBOUND arrayBound[1];
arrayBound[0].cElements = fileSize - 1;
arrayBound[0].lLbound = 0;
pSafeArray = ::SafeArrayCreate(VT_UI1, 1, arrayBound);
for(long i = 0; i < fileSize-1; i++)
::SafeArrayPutElement(pSafeArray, &i, bitBuffer++);
bitData.parray = pSafeArray;
m_pRecordset->GetFields()->GetItem(_bstr_t(field))->AppendChunk(bitData);
}
看了好久不是太理解 高手能点同一下吗
BOOL CADOOperation::SetItemContent(CString field, DWORD type, const void *variable)
case ADO_TYPE_BITMAP_FIEL:
{
CString* lpStr = (CString*)variable;
VARIANT bitData = {0};
CFile file(*lpStr, CFile::modeRead);
DWORD fileSize = file.GetLength() + 1;
char* bitBuffer = new char[fileSize];
file.ReadHuge(bitBuffer, fileSize);
file.Close();
bitData.vt = VT_ARRAY | VT_UI1;
SAFEARRAY* pSafeArray;
SAFEARRAYBOUND arrayBound[1];
arrayBound[0].cElements = fileSize - 1;
arrayBound[0].lLbound = 0;
pSafeArray = ::SafeArrayCreate(VT_UI1, 1, arrayBound);
for(long i = 0; i < fileSize-1; i++)
::SafeArrayPutElement(pSafeArray, &i, bitBuffer++);
bitData.parray = pSafeArray;
m_pRecordset->GetFields()->GetItem(_bstr_t(field))->AppendChunk(bitData);
}
看了好久不是太理解 高手能点同一下吗