PDA

View Full Version : OS9: FspOpenResFile( GetFSpec( shlb ) ) ?




zeppenwolf
Nov 19, 2009, 12:26 AM
Hi.

Sorry-- I could probably (?) answer this question for myself, but I'm moving all my stuff from old computers to newer ones at the moment, and right now I don't know where anything is, it's all a disaster trying to get rid of the old machines...


My 9 app links to a 'shlb' that might be here, or there, or somewhere; I need to open it's resfile.

Thanks.



kainjow
Nov 19, 2009, 12:08 PM
From a google it looks like "shlb" just represents a generic shared library. Are you looking for a specific file?

And why are you still developing for an ancient OS :p

chown33
Nov 19, 2009, 02:17 PM
Use Find (cmd-F in Finder) to search for files with the given file type. You will probably have to use the "Other" choice to enable file types.

If that doesn't work, post again with more info, like what the filename of this shlb is. You should be able to find that in the source file.

zeppenwolf
Nov 20, 2009, 02:09 AM
Ok guys, I should have been more specific-- you're on the wrong track.

It's not a question of me personally finding some specific file in the Finder; it's a question of my code being able to get an FSSpec for a dynamically loaded library.

I have an application which dynamically links to a shlb of a certain id. The shlb is not necessarily in one place, it could be different places, and between application runs, it might be a *different* shlb, a different file, with a different Finder name.

Confusing? It's a way of getting one app to do different tasks depending on which shlb is (deliberately) made available. Think of the shlb as a "plug in"-- that's kinda how it is. I can switch plug ins between app runs so that the app will do different things.

So I need to get the FSSpec of the Finder file in which the Code Fragment Manager, at app runtime, located the necessary library. The Finder, I believe, first looks in the folder in which the app ran, then mucks around in the System Folder...

I could do the same thing, but that would be goofy-- there must be a way to go more directly from INPUT( 'shlb', 'Pow!' ) to OUTPUT( FSSpec of "Power Plugin" file ) After all, the Finder just did all that work of finding the physical file, so I shouldn't have to repeat the same work.

Is it clear now?

Why dev for OS9? Eh... Because I'm still using it.

A bit. :)

chown33
Nov 20, 2009, 02:48 PM
The Finder, I believe, first looks in the folder in which the app ran, then mucks around in the System Folder...

Nope. The Finder plays no role. It's all in the hands of the Code Fragment Manager.

On modern systems (Mac OS X) it's in the hands of the dylib loader. See man dyld.

kainjow
Nov 20, 2009, 02:53 PM
Maybe GetSharedLibrary() is what you want?

You might have better luck asking here: http://lists.apple.com/mailman/listinfo/carbon-dev

zeppenwolf
Nov 21, 2009, 01:04 PM
chown> On modern systems (Mac OS X) it's in the hands of the dylib loader. See man dyld.

Yes, but that's for X only code, in fact, I think, 10.4 or later. The situation is OS9/Carbon, and even under 10.2.8


kainjow> Maybe GetSharedLibrary() is what you want?

Well it's hard to say!! It kinda looks promising... but I think that f() is meant to load a shlb?? I dunno-- I stare at the function declaration in Cfm.h and I have a hard time figuring out even which params are input and which are output!!

If I search for "GetSharedLibrary" at the Apple Dev site, I get, "No Results Found".

Sheesh!! Come on, Apple!

Anyway, I signed up to that mailing list you mentioned, I'll try there.

Thanks to everyone, including, but not limited to, the hamster.

Or is that a gerbil?

(Ohmigod! Did I just commit a heinous racial faux pas?!? (Get it? "pas"?) I'm outta here!)

Thx everyone.