Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Carbon/TWAIN issues...

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  Applescript: Controlling an app on another machin..  
Author Message
Phillip Kavan

External


Since: Jul 23, 2003
Posts: 4



(Msg. 1) Posted: Sun Feb 29, 2004 7:23 pm
Post subject: Carbon/TWAIN issues...
Archived from groups: comp>sys>mac>programmer>help (more info?)

first, a little background...i want my Carbon app to run on BOTH Classic
MacOS v8/9 as well as MacOS X. therefore i build it as a CFM app, not a
Mach-O one (currently using CWPro9). here are the MacOS TWAIN DSM CFM
shared library files that i am aware of:

\System Folder\Extensions\TWAIN Source Manager (from TWAIN SDK v1.7)
\System\Library\CFMSupport\TWAIN Source Manager.shlib (from TWAIN SDK
v1.9)

Problem #1:
...the TWAIN CFM library that comes with v1.7 of the SDK appears to
require InterfaceLib, which is available in Classic MacOS, but not in
MacOS X. so i cannot weak-link my Carbon app to the v1.7 CFM library if
i want it to run in MacOS X, correct? however, it appears that i also
cannot weak-link my Carbon app to the v1.9 CFM library if i want it to
run in Classic MacOS, because i think that one calls through to
TWAIN.framework, correct? so in short, i'm curious what the solution is
(if any) if i want to build a *single* CFM Carbon app that can run in
both Classic MacOS and MacOS X, and can communicate with the DSM in both
environments? is that possible?

Problem #2:
....for testing purposes, i've set up my Carbon app to weak-link to v1.9
of the CFM DSM shared library (the one in \System\Library\CFMSupport)
and i am just testing it under OS X for the time being. when i
initialize via TWInitialize() (found in TWGlue.c), it appears that by
copying certain strings into the 'Manufacturer' field of the TW_IDENTITY
structure, TWSelectDS() will fail later on with a result code of -4971
(an error code that's associated with the DataBrowser object in the
selection popup). for example, "\pWorking Group" doesn't cause any
problems, but "\pEggshell Software" results in the error. another
example: "\pBig John Productions" is fine, but "\pLittle John
Productions" is not. TWOpenDSM() does get through successfully (it
returns 'TWRC_SUCCESS'), so i'm not sure what's going on here. to verify
that it's not my app, i "Carbonized" the Sample App code that
accompanied v1.7 of the TWAIN SDK and weak-linked it to the same CFM
TWAIN DSM library (v1.9), and i notice the same results. however, the
sample app that accompanies v1.9 of the TWAIN SDK is a Mach-O target,
and that seems to work fine with any manufacturer name i set. any ideas?
has anyone else encountered this problem with a CFM app running under OS
X?

TIA -phil.
Back to top
Login to vote
Thomas Engelmeier

External


Since: Sep 11, 2003
Posts: 209



(Msg. 2) Posted: Mon Mar 01, 2004 7:25 am
Post subject: Re: Carbon/TWAIN issues... [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

> (if any) if i want to build a *single* CFM Carbon app that can run in
> both Classic MacOS and MacOS X, and can communicate with the DSM in both
> environments? is that possible?

IIRC, Graphic Converter does it.
You probably'll want to use the Code Fragment Manager to resolve the
Twain shared libraries. It is not too hard as the whole Twain interface
uses just one function / entry point for communication.

Be aware the two SDK header files are different. Even if you introduce
the XFER_FILE transfer method in the Twain 1.9 SDK or the XFER_FILE2
transfer method in the 1.7 SDK you end up in maintenace hell.

I recommend you to set up two CFPlugins that handle the scanning part,
each linked against "it's native" SDK, and load them on demand in order
to avoid the mixup of the two different SDKs.

On OS X, you might install the Twain-SANE stuff from <http://www.ellert.se/twain-sane/>
and change in /usr/local/etc/sane.d/dll.conf the line #test to test.
That gives you some test datasource that provides far more testcases
than the usual SDK ones.

regards,
Tom_E

--
This address is valid in its unmodified form but expires soon.
Back to top
Login to vote
Display posts from previous:   
Related Topics:
pthread_create and Carbon App - Hello, I have loaded the system.framework from a Carbon App. Now, I would like to create a thread using the pthrea...

how to write carbon application - hai all I would like to write carbon application on Mac 9.0 . Let me know which software are to be installed on Ma...

Resource files and Carbon - PLEASE HELP! - I've been messing with this for hours, and am at my wit's end. If anyone has an ideas, please help! I find that when ...

Using Image Well with Carbon API - Can anyone tell me how to draw an "image well" control in the selected state as the illustration in the OS8 H...

OSX Carbon Console??? - How can I printf() or fprintf(stderr,) using the project builder for OSX Carbon? The debug thingy has a Standard I/O ta...

Accessing files from carbon - Hi, I'm buiding a small Carbon (with nibs) app using project builder on OS X 10.2.8. I would like to use a file to st...
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]