Class Changer v1.0 by Richard Burgess About This little hack will allow you to add additional "class" fields to BArchivable objects archived to resources. I'm uploading this on the off chance that anyone else might find it useful. I wrote this in response to what I perceive to be a deficiency with all the Be interface builders that I've tried. Namely, that you're not able to create your own classes in them without writing some sort of editor for it. This addresses the problem by allowing you to create your interface using whatever the base class for your derived class is as a "proxy" and then put in the "real" name of the class afterwards (very much like what Metrowerks' Constructor for the MacOS does) Hopefully someone will add this feature to an existing interface builder at some point, since I don't feel like writing one myself just to add this one thing :) It should be easy enough to add, since according to the BeBook, instantiate_object will just go down the list of class names until it gets one it has a Instantiate function for. The interface builder would just need to keep track of the real class until it's time to archive them out. Using After selecting a resource file, you'll get a list of all the resource in the file (if not, then it wasn't a resource file) If the resource is a BArchivable object, double-clicking on a selection will bring up another window with all the archived objects in it. Double clicking on any of these will bring up a window allowing you to add another "class" field to the archived object. Now, when you go to instantiate the archive in your program, your derived classes will be instantiated instead of the parent ones. Now for the caveats... Interface Elements doesn't know anything about all this trickery, so if you try opening your changed resource file, the objects with new class names won't show up and won't be saved. So you should probably make a copy of the resource files you change. No Intel version because I couldn't get the thing to compile, the MSL library kept crashing Codewarrior. Gotta have that string class :) I'll email anybody the code if they're interested. Rick's number one rule for making BArchivable objects work: MAKE SURE YOU EXPORT THE CLASS! This is a hard-earned lesson that isn't mentioned anywhere in the BeBook but which is absolutely essential to make the BArchivable mechanism work. This is how instantiate_object knows about all the BArchivable objects. The easiest way to do this is to choose 'export all ' in PEF settings, alternatively, you could use #pragma export. If you don't do this your objects won't be instantiated and the code might not even be compiled in at all if it's not directly referenced anywhere. I just hacked this together over a couple hours after playing with Interface Elements for while, so the interface is pretty minimal and there's bound to be a few bugs, memory leaks, etc. If you find any, let me know, otherwise as it gets the job done for me, I don't plan on making any more improvements to it. Send comments, suggestions, hate mail, etc, to: rickb@spy.net http://www.rickb.com