Re: Objects in VM files

GWRepNate@aol.com
Mon, 25 Nov 1996 11:22:54 -0500

In a message dated 96-11-24 18:57:21 EST, edwdig@bergen.org (Edward Di
Geronimo Jr.) writes:
> Um, that can't be right. How would the system be able to guarentee the same
> memhandle being shutdowns? Or if I quit the program, launch another
program,
> then run my program again? I learned how to use VMPreserveBlocksHandle and
> VMVMBlockToMemHandle from the SimpWP sample app.

If your program exits I would hope you close the document. When you close
it all the blocks will be detached.

> But I do need it unusable, right?

Yes.

> I tried fiddling with the threads, and I found this out: If I run the code
> from the ui thread, like I originally was, the calls to the vm objects
hang.
> If I run the code from the process thread, the calls work but I can't add
> the objects to the UI tree. It complains about locking the object block
from
> the wrong thread. Next I tried doing everything but the adding children in
> the process thread, and sending a message to the application object to do
> the children adding. That causes it to kinda work, but the new objects are
> unstable and don't always add correctly, or if they do they don't work
right.

This is what I do in Draw, from the process thread, and it works:

@call DPrimary::MSG_GEN_ADD_CHILD( @DTranGroup,
( CCF_MARK_DIRTY | TRANSFORM_MENU_POSITION ) );
@call DTranGroup::MSG_GEN_SET_USABLE( VUM_DELAYED_VIA_APP_QUEUE );

Nathan