Discussion:
Porting OS9 PP app, LWindow updateRgn always empty
(too old to reply)
Stephen Kay
2006-04-05 19:36:56 UTC
Permalink
I'm attempting to follow the instructions in Apple's Carbon Porting Guide,
to port an OS9 PowerPlant app to OSX (using PP 2.2.2). I'm at the first
stage, where you try to carbonize the code, while linking to your normal
libraries, plus CarbonAccessors.o.

I have #defined:

#define ACCESSOR_CALLS_ARE_FUNCTIONS 1
#define OPAQUE_TOOLBOX_STRUCTS 1

...and I have fixed all the errors related to the opaque structures etc, and
am able to link and run.

However, I'm having a problem where, in PowerPlant's LWindow::UpdatePort(),
the updateRgn for every single window in the application is empty when
UpdatePort() is called, and so it exits and nothing is drawn in any of the
windows.

It calls ::GetWindowRegion(mMacWindowP, kWindowUpdateRgn, updateRgn).

Universal Headers states that this function is supposed to be available in
CarbonAccessors.o. But it always is returning an empty region.

If I comment out the test for ::EmptyRgn(updateRgn), then the rest of the
code in LWindow::UpdatePort() is performed, and they all draw as per normal.
Obviously, this isn't the fix I need. ;-)

Anybody hear of this problem before? I've been trying to track what might be
causing this, and I don't have a clue yet.

Thanks,
--
Stephen Kay
Karma-Lab ***@karma-lab.NOSPAM.com
^^^^^^^
Stephen Kay
2006-04-07 05:41:42 UTC
Permalink
I am porting a PowerPlant app to Carbon, I am now at the point where I am
trying to link against CarbonLib, on OS 9.2.2.

The app links, but when it launches, it immediately quits with an error of
"Could not launch "app" because the library ">>CarbonLib<<" was not found.

Of course, I have CarbonLib 1.6.1 installed in my Extensions.

I have searched the archives:

I've seen references to needing a SIZE resource with ID -1.
- I have that.

I also have all the bits set for AcceptSuspendResumeEvents, canBackground,
doesActivateonFGSwitch,is32bitCompatible,isHighLevelEventAware,
localAndRemoteHLEvents.

I saw mention of not enough memory allocated to the app. I have plenty.

Someone else said this might be caused by also having InterfaceLib in the
project. Well, I can't remove InterfaceLib, or I get a zillion other link
errors at this point in the port. However, that is the only other lib still
being included.

Any ideas?

Thanks,
Stephen Kay
Karma-Lab ***@karma-lab.NOSPAM.com
^^^^^^^
p***@mac.com
2006-04-07 23:07:23 UTC
Permalink
Post by Stephen Kay
I am porting a PowerPlant app to Carbon, I am now at the point where I am
trying to link against CarbonLib, on OS 9.2.2.
The app links, but when it launches, it immediately quits with an error of
"Could not launch "app" because the library ">>CarbonLib<<" was not found.
Someone else said this might be caused by also having InterfaceLib in the
project. Well, I can't remove InterfaceLib, or I get a zillion other link
errors at this point in the port. However, that is the only other lib still
being included.
They're right. You can't link against both InterfaceLib and CarbonLib.
Remove InterfaceLib and then solve the link errors; they're probably
things that don't exist anymore in Carbon that you have to call
replacements for.
Stephen Kay
2006-04-12 19:02:40 UTC
Permalink
Post by p***@mac.com
Post by Stephen Kay
I am porting a PowerPlant app to Carbon, I am now at the point where I am
trying to link against CarbonLib, on OS 9.2.2.
The app links, but when it launches, it immediately quits with an error of
"Could not launch "app" because the library ">>CarbonLib<<" was not found.
Someone else said this might be caused by also having InterfaceLib in the
project. Well, I can't remove InterfaceLib, or I get a zillion other link
errors at this point in the port. However, that is the only other lib still
being included.
They're right. You can't link against both InterfaceLib and CarbonLib.
Remove InterfaceLib and then solve the link errors; they're probably
things that don't exist anymore in Carbon that you have to call
replacements for.
Thank you for confirming this. That's now what I'm doing.
--
Stephen Kay
Karma-Lab ***@karma-lab.NOSPAM.com
^^^^^^^
Loading...