Re: vm blocks, structs etc

GWRepJohnH@aol.com
Tue, 31 Dec 1996 11:53:43 -0500

Hi Ed,

A couple of things. First, I don't see anywhere in your snips that you
dirtied and unlocked the map block in the initialize document method. I did
see the dirty and unlock for the object block. This may be a part of your
problem.

Second - Are you using Swat? If so, I would single step thru the attach ui
method where you are getting the pointer to the name and copying it to the
char string, and see if name is actually getting the object name you've
saved. If you're not using Swat (you should try it!) you might try and
output name to a temporaty dialogbox to see if you are getting the name. If
you are seeing KR-05, 6 or 7 crashes, that would tend to indicate string
problems where a string (often too long for your variable) is overwriting
code. Another good thing about Swat is that it will yell at you when you
exit an app and have neglected to unlock any blocks (a very difficult bug to
track down without Swat!)

I've used the VMMapBlock routines a lot and yours look OK from here. I have
seen some sample code where the pointer returned using VMLock is cast to the
proper structure type like this:
map = (mapblock *) VMLock(file, mapBlock, &maphandle);
but I don't know if it is really necessary.

Hope this helps...
John ;-)