Re: Objects in VM files

Edward Di Geronimo Jr. (edwdig@bergen.org)
Sun, 24 Nov 1996 18:44:54 -0500

>If you're using VMPreserveBlocksHandle() then you don't have to reconstruct
>the optr for the duplicate primary object. In fact, doing so may give you the
>wrong handle (not sure about that). Using VMPreserveBlocksHandle() you can
>construct the optr to the duplicate once and keep using that same optr until
>you detach for free the block. You can save the optr as part of the instance
>data of the document object, for convenience.

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.

>Three other things: 1) You don't need to set the object disabled to add it to
>another object.

But I do need it unusable, right?

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.

Ideas?

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