Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / October 2005



Tip: Looking for answers? Try searching our database.

Which Project to choose? and/or how to configure it properly?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Denis @ TheOffice - 25 Oct 2005 16:54 GMT
I am having difficulties in terms of project configuration:
I am making a bundle as a twain ds.

The problem is in the doc from twain or Apple it does not tell precisely how to configure your
project in CW.

I do have an example from another scanner fabricant.

When I choose a new project base on mach-o-toolbox bundle
The main module under Mac Os in the content of the package report itself as a kind : unix executable
file.
That does not seem to fly with the image capture software for ds???

So I am trying to do an application with the C++ Mac Os Carbon toolbox bundle.
It seems to build fine for what I am trying to do.
But there is no tab for framework;
How do I include IOKit support for that type of application?

Thanks for any help.
DC
Chris Hanson - 25 Oct 2005 17:23 GMT
> The problem is in the doc from twain or Apple it does not tell
> precisely how to configure your
> project in CW.

To fill in the blanks a little, the Apple documentation you're
referring to is Technical Note TN2088, "TWAIN Data Sources for Mac OS
X" <http://developer.apple.com/technotes/tn2002/tn2088.html>, correct?

This document describes the layout of TWAIN data source bundles on Mac
OS X and where they should be located.  You're right that it doesn't
have detailed project configuration information for different
development environments.  However, it should be straightforward given
the information in this document to configure a project to produce
what's required.

> When I choose a new project base on mach-o-toolbox bundle
> The main module under Mac Os in the content of the package report
> itself as a kind : unix executable
> file.
> That does not seem to fly with the image capture software for ds???

What would lead you to believe this?  Generally, the contents of a
bundle are a Mach-O executable or library, depending on the type of
bundle you're trying to create.  Loadable bundles are generally
"executables" (with Mach-O type MH_BUNDLE) while frameworks are
generally "dynamic libraries" (with Mach-O type MH_DYLIB).

If your bundle isn't being loaded, that's something you'll have to
figure out how to debug.  I wouldn't blame the packaging unless I had
some direct evidence (in the form of log statements somewhere, most
likely) that the packaging was at fault.

Here's a question: Are you really creating a *bundle*?  Or are you
creating a *bundled application*?  They're different things; the former
is something that can be only loaded by  something else, while the
latter can only be run directly.

> So I am trying to do an application with the C++ Mac Os Carbon toolbox bundle.
> It seems to build fine for what I am trying to do.
> But there is no tab for framework;
> How do I include IOKit support for that type of application?

I haven't used CodeWarrior in a few years, but from what you say above
it sound like you're actually creating an application rather than a
bundle.  This is almost certainly not what you want.  Instead, you
should create a bundle and configure it to have the appropriate layout,
Info.plist keys, DeviceInfo.plist, and so on as described in the tech
note.

This is pretty straightforward in Xcode, I would assume it's pretty
straightforward in CodeWarrior too.

 -- Chris
Denis @ TheOffice - 25 Oct 2005 18:04 GMT
Thanks for your answer.

> > The problem is in the doc from twain or Apple it does not tell
> > precisely how to configure your
[quoted text clipped - 3 lines]
> referring to is Technical Note TN2088, "TWAIN Data Sources for Mac OS
> X" <http://developer.apple.com/technotes/tn2002/tn2088.html>, correct?
Yes, I read it but since I still consider myself a newbie in Mac, there many thing in there I do not
master.
I would have appreciated a guide line for CW instead.

> This document describes the layout of TWAIN data source bundles on Mac
> OS X and where they should be located.  You're right that it doesn't
> have detailed project configuration information for different
> development environments.  However, it should be straightforward given
> the information in this document to configure a project to produce
> what's required.
I kind of successully done one so far, but when I use the test tool from the apple sampleds sdk In
XCode only.
It reports this:

Image Capture Support:
Could not match 'PenTwain Debug DS' to any of the installed TWAIN Data Sources

It could be that the TWAIN DS bundle does not have a 'DeviceInfo.plist' in Resource folder

Image Capture may not work properly with the DS

But there is a valid device info in the resource folder.

When I compare my ds with the Canon one I see that is main module is "Kind" {APPL}

> > When I choose a new project base on mach-o-toolbox bundle
> > The main module under Mac Os in the content of the package report
[quoted text clipped - 7 lines]
> "executables" (with Mach-O type MH_BUNDLE) while frameworks are
> generally "dynamic libraries" (with Mach-O type MH_DYLIB).
What lead me to that sort of conclusion is I checked everything else.

And the Canon ds.

> If your bundle isn't being loaded, that's something you'll have to
> figure out how to debug.  I wouldn't blame the packaging unless I had
> some direct evidence (in the form of log statements somewhere, most
> likely) that the packaging was at fault.
No, it is getting loaded by many application (Photoshop, OmniPage and the test software in cocoa
from apple)

Just the image capture program refuse to load it.

And in case you ask (my device is hook up on usb)

> Here's a question: Are you really creating a *bundle*?  Or are you
> creating a *bundled application*?  They're different things; the former
> is something that can be only loaded by  something else, while the
> latter can only be run directly.

Well I tried as a bundle only at first but seems the Canon seems to be an App.

I just don't know anymore.

> > So I am trying to do an application with the C++ Mac Os Carbon toolbox bundle.
> > It seems to build fine for what I am trying to do.
[quoted text clipped - 7 lines]
> Info.plist keys, DeviceInfo.plist, and so on as described in the tech
> note.

That's the thing I don't get when I create a new project there is no notion of application or
library bundle.

First they are all called "Toolbox" I think if they all are I don't see the relevance.

I would rather choose between Application or Lib, that would make more sense to me.

Here are the choice it gives me for a C++ stationary:

- Mac Os Carbon

   - Mac Os Shared lib

- Mac Os Classic

   - Mac Os Classic Shared lib

   - Mac Os Toolbox

       - C++ Toolbox Classic

       - C++ Toolbox Classic bundle

- Mac Os Mach O

   -Mac Os Toolbox

       -C++ Carbon Toolbox

       -C++ Carbon Toolbox bundle

       -C++ Carbon Toolbox bundle with Nib

   - Mac Os X framework

-Multi Target

   - Mac Os Toolbox

       -C++ Multi target toolbox

       -C++ Multi target toolbox bundle

       -C++ Multi target toolbox Nib bundle

I have remove the standard console because I am sure this is not it.

Which one would choose?

Thanks

DC

> This is pretty straightforward in Xcode, I would assume it's pretty
> straightforward in CodeWarrior too.
>
>   -- Chris
Thorsten Froehlich - 27 Oct 2005 15:58 GMT
> First they are all called "Toolbox" I think if they all are I don't see the relevance.

Well, that is because you don't know the meaning of that term as Apple
has erased it from all documentation since the Next takeover. In the
past few years they have also done a lot to sabotage CodeWarrior users
by removing (or hiding well in what they claim to be legacy sections) a
lot of helpful documentation they once had. So you might need to dig
there, too, if you are new to the platform and don't know your way
around yet.

> I would rather choose between Application or Lib, that would make more sense to me.

Yes, but that would not be the _complete_ correct terms on a Mac, so
you won't find them! ;-)

You should look for targets ending with "Shared Library" (the Mac OS /
Carbon CFM term) and "Framework" (the Mac OS X Mach-O term) if you are
looking for "library".

> Here are the choice it gives me for a C++ stationary:
>
[quoted text clipped - 3 lines]
>
> - Mac Os Classic

Either you inserted the wrong stuff in your posted message or there is
something missisng from your install: under "Mac OS Carbon" there
should be a "Mac OS Toolbox" section, which contains various targets.

Either way, what the stationary contains is not *all* you can create,
it only contains templates for the most *common* targets users need. It
may well be possible that your probject (I don't know, that is for you
to find out yourself!) requires something different. In that case,
create a stationary close to what you need and then adjust the project
settings. Metrowerks includes good manuals as PDFs (and HTML) with
CodeWarrior, so you may actually have to read them to find our what you
need to change to get the kind of traget configuration you want.

   Thorsten
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.