Objects in VM files

Edward Di Geronimo Jr. (edwdig@bergen.org)
Sat, 23 Nov 1996 12:36:18 -0500

Hi everyone,

I'm trying to run objects from a VM file. When I set up the objects in
MSG_GEN_DOCUMENT_INITIALIZE_DOCUMENT_FILE, I duplicate a resource and then
use VMAttach, then tell the file to use the same mem handle (forget the
function name). After that I send a few messages to the objects and they
work fine. But then if I try to send one of the objects a message from in
MSG_GEN_DOCUMENT_ATTACH_UI_TO_DOCUMENT, it hangs the thread. It even hung
swat on me. Here's what I'm doing:

/*
* mapBlock - VMBlockHandle
* maphandle - MemHandle
* map - pointer to a struct
* NewObjectsHandle - Global MemHandle
*/

mapBlock = VMGetMapBlock(file);
map = VMLock(file, mapBlock, &maphandle);
NewObjectsHandle = VMVMBlockToMemBlock(file, map->objectVMH);
VMUnlock(maphandle);

@call ConstructOptr(NewObjectsHandle,
OptrToChunk(@NewPrimaryTemplate))::MSG_GEN_SET_NOT_USABLE(VUM_NOW);
@call ConstructOptr(NewObjectsHandle,
OptrToChunk(@NewPrimaryTemplate))::MSG_GEN_SET_NOT_ENABLED(VUM_NOW);
@call App::MSG_GEN_ADD_CHILD(ConstructOptr(NewObjectsHandle,
OptrToChunk(@NewPrimaryTemplate)), (CCF_MARK_DIRTY | CCO_LAST));
@call ConstructOptr(NewObjectsHandle,
OptrToChunk(@NewPrimaryTemplate))::MSG_GEN_SET_USABLE(VUM_NOW);
@call ConstructOptr(NewObjectsHandle,
OptrToChunk(@NewPrimaryTemplate))::MSG_GEN_SET_ENABLED(VUM_NOW);

The thread hangs on the first @call. But similar code works in the earlier
messages. What am I doing wrong?

-------------------------------------------------------------------
| Edward Di Geronimo Jr. edwdig@bergen.org |
-------------------------------------------------------------------