~~~~~~~~~~~~~~~~!!!!!!!!!!!!!!!!!!!!!!!
解决方案 »
- 在CHtmlView中如何接收iframe内元素的Onclick事件?
- 用DialogBox打印的对话框怎么修改背景啊
- 使用ODBC向MSSQL中添加记录,添加第一条记录时程序崩溃,为什么?
- 如何生成dvd的vob文件
- 现有一个指向内存的一个指针,如果在当前位置上移动指针(100),怎么实现?
- 急!关于改名问题
- 200分在线相送->谁能给我一个完整的MP3音频流服务器端和客户端的解决方案.
- 大伙帮我看看,帮个忙啊,急~
- 请帮帮忙很急 衷心感谢!!谁能给我一点短信网关开发的思路!!谢谢谢谢谢谢!!!
- AngleArc()不能适用于MetaFileDC吗?
- 如何降低VC程序的CPU的占有率?
- VC中当一个窗口被另一个窗口覆盖时,如何得到此消息?
{
// object can be NULL ASSERT(IsStoring()); // proper direction if (!IsStoring())
{
AfxThrowArchiveException(CArchiveException::readOnly, m_strFileName);
} DWORD nObIndex;
ASSERT(sizeof(nObIndex) == 4);
ASSERT(sizeof(wNullTag) == 2);
ASSERT(sizeof(wBigObjectTag) == 2);
ASSERT(sizeof(wNewClassTag) == 2); // make sure m_pStoreMap is initialized
MapObject(NULL); if (pOb == NULL)
{
// save out null tag to represent NULL pointer
*this << wNullTag;
}
else if ((nObIndex = (DWORD)(DWORD_PTR)(*m_pStoreMap)[(void*)pOb]) != 0)
// assumes initialized to 0 map
{
// save out index of already stored object
if (nObIndex < wBigObjectTag)
*this << (WORD)nObIndex;
else
{
*this << wBigObjectTag;
*this << nObIndex;
}
}
else
{
// write class of object first
CRuntimeClass* pClassRef = pOb->GetRuntimeClass();
WriteClass(pClassRef); // enter in stored object table, checking for overflow
CheckCount();
(*m_pStoreMap)[(void*)pOb] = (void*)(DWORD_PTR)m_nMapCount++; // cause the object to serialize itself
((CObject*)pOb)->Serialize(*this);
}
}CObject* CArchive::ReadObject(const CRuntimeClass* pClassRefRequested)
{
ASSERT(pClassRefRequested == NULL ||
AfxIsValidAddress(pClassRefRequested, sizeof(CRuntimeClass), FALSE));
ASSERT(IsLoading()); // proper direction
ASSERT(wNullTag == 0);
ASSERT((wClassTag << 16) == dwBigClassTag);
ASSERT((wNewClassTag & wClassTag) == wClassTag); if (!IsLoading())
{
AfxThrowArchiveException(CArchiveException::writeOnly, m_strFileName);
} // attempt to load next stream as CRuntimeClass
UINT nSchema;
DWORD obTag;
CRuntimeClass* pClassRef = ReadClass(pClassRefRequested, &nSchema, &obTag); // check to see if tag to already loaded object
CObject* pOb;
if (pClassRef == NULL)
{
if (obTag > (DWORD)m_pLoadArray->GetUpperBound())
{
// tag is too large for the number of objects read so far
AfxThrowArchiveException(CArchiveException::badIndex,
m_strFileName);
} pOb = (CObject*)m_pLoadArray->GetAt(obTag);
if (pOb != NULL && pClassRefRequested != NULL &&
!pOb->IsKindOf(pClassRefRequested))
{
// loaded an object but of the wrong class
AfxThrowArchiveException(CArchiveException::badClass,
m_strFileName);
}
}
else
{
// allocate a new object based on the class just acquired
pOb = pClassRef->CreateObject();
if (pOb == NULL)
AfxThrowMemoryException(); // Add to mapping array BEFORE de-serializing
CheckCount();
m_pLoadArray->InsertAt(m_nMapCount++, pOb); // Serialize the object with the schema number set in the archive
UINT nSchemaSave = m_nObjectSchema;
m_nObjectSchema = nSchema;
pOb->Serialize(*this);
m_nObjectSchema = nSchemaSave;
ASSERT_VALID(pOb);
} return pOb;
}