rk39+@andrew.cmu.edu (Robert Joseph Kuszewski) (06/14/90)
TWIMC, I've been experiencing some THINK C (v 4.0) problems, which I'm having a hard time explaining. It's probably something simple, but I need an answer. Here's the situation: I'm writing a program which can have several files (and windows) open at once. They are stored in a struct array with a bunch of other information. All the windows are stored as resources. I have compiled the program as an application and added the resources with RedEdit. On startup, the program should open a tools window and an untitiled working windoe. The first window opens just dandy. But when it tries to open the second, it hangs up completely. I can avoid this, if I send a new (dummy) window record to GetNewWindow. The problem is, when it gets into the main event loop, it crashes whenever I click in any of the windows (includeing the move/title bar). I think it's because of this screwed up window record thing. Is every window supposed to have it's own window record? I've never needed a seperate wRecord for each window before (when I programmed in Pascal). Any suggestions? Thanks in advance, Bob
austing@Apple.COM (Glenn L. Austin) (06/17/90)
rk39+@andrew.cmu.edu (Robert Joseph Kuszewski) writes: >Here's the situation: I'm writing a program which can have several >files (and windows) open at once. They are stored in a struct array >with a bunch of other information. All the windows are stored as >resources. I have compiled the program as an application and added the >resources with RedEdit. On startup, the program should open a tools >window and an untitiled working windoe. The first window opens just >dandy. But when it tries to open the second, it hangs up completely. I >can avoid this, if I send a new (dummy) window record to GetNewWindow. >The problem is, when it gets into the main event loop, it crashes >whenever I click in any of the windows (includeing the move/title bar). >I think it's because of this screwed up window record thing. Is every >window supposed to have it's own window record? I've never needed a >seperate wRecord for each window before (when I programmed in Pascal). >Any suggestions? Each window stores vital information about itself in the window record. If you are sharing window records among several windows, the Window Manager doesn't know which window you are manipulating. Unless you are concerned about heap space, go ahead and let the Window Manager allocate the memory in the heap by passing NIL to windowStorage. Otherwise, you'll need a separate pointer for each window. -- ----------------------------------------------------------------------------- | Glenn L. Austin | "Turn too soon, run out of room, | | Auto Racing Enthusiast and | Turn too late, much better fate" | | Communications Toolbox Hacker | - Jim Russell Racing School Instructors | | Apple Computer, Inc. | "Drive slower, race faster" - D. Waltrip | | Internet: austing@apple.com |-------------------------------------------| | AppleLink: AUSTIN.GLENN | All opinions stated above are mine -- | | Bellnet: (408) 974-0876 | who else would want them? | -----------------------------------------------------------------------------