take a look at DuplicateHandle, and use 1 handle for writing and the other for reading.. hope this helped :) B.Bruggeman
BruteBertus
Posts
-
How to use same handle in seperate thread -
CRuntimeClass::CreateObject() and deleteI also thought it was a memoryleak/overwrite but i wrote a simple test program and than already it assert's about the debug-memory-tracing-variable m_nBockUse, but when i use new/delete it doesn't assert.. i have different kind of classes in a list and i want to serialize them using Write/ReadObject, so i can't use an ordinary new/delete operator. but when i tested this it asserts in the (debug) operator delete, so i tested it with the lines i posted before, but it still asserted.. so do you have other suggestions? btw in the file afxmem.cpp are many operator delete which (in debugmode) either call _free_dbg(p, _CLIENT_BLOCK); or _free_dbg(p, _NORMAL_BLOCK);, so probably the wrong deconstructor is called.. but how do I fix this? TIA. B.Bruggeman
-
CRuntimeClass::CreateObject() and deleteI tried to create a cobject derived class: CObject*t=(CObject*)RUNTIME_CLASS(CHScrollTitle)->CreateObject(); and then i tried to free it with: delete t; or CHScrollTitle::operator delete(t); but the delete operator failes in debug-mode with an assert-notice. (something with pHead->nBlockUse==nblockuse) does anybody know how to free a with CreateObject(or CArchive::ReadObject()) created object? \ TIA B.Bruggeman