OValue val;
val.SetEmpty();
OBlob oblob; ores = odyn.SetFieldValue((const char *)"Map_INFOS",val);
ores = odyn.Update();
odyn.StartEdit();
odyn.GetFieldValue("Map_INFOS",&oblob);
unsigned char *buffer = 0;
try
{
// calculate an optimum buffersize of approximately 32k bytes
unsigned long optchunk = oblob.GetOptimumChunkSize();
unsigned int bufsize = ((int)(32768/optchunk)) *optchunk;
buffer = (unsigned char *)malloc(bufsize);
//open file and get file size
CFile *pFile=new CFile(m_szFileName,CFile::modeRead|CFile::shareDenyNone|CFile::typeBinary);
pFile->SeekToEnd();
unsigned long filesize = pFile->GetLength();
pFile->SeekToBegin();
unsigned long totalwritten = 0;
unsigned long amtread = 0;
int piecetype = OLOB_FIRST_PIECE;
//By taking advantage of streaming we get the best performance
//and we don't need to allocate a huge buffer.
if (filesize <= bufsize)
piecetype = OLOB_ONE_PIECE;
else            
oblob.EnableStreaming(filesize);
while(totalwritten != filesize)
{
pFile->Read(buffer, bufsize);
amtread = pFile->GetLength();
oblob.Write(buffer, amtread, piecetype);        
totalwritten = totalwritten + amtread;
if ((filesize - totalwritten)<=bufsize)
piecetype = OLOB_LAST_PIECE;
else 
piecetype = OLOB_NEXT_PIECE;
}
oblob.DisableStreaming();
ores = odyn.Update();
pFile->Close();
}
catch (OException e) 
{
AfxMessageBox((CString)e.GetFailedMethodName() + e.GetErrorText());
}
if (buffer)
free(buffer);
OShutdown();
}try的第一行unsigned long optchunk = oblob.GetOptimumChunkSize();出错,提示如下
This operation is not permited on a Null Lob怎么办?