Home › Forums › TWAIN Mac/OSX › C++ Problem in Macintosh
- This topic has 5 replies, 2 voices, and was last updated 6 years, 10 months ago by aron.
- AuthorPosts
Hi..
I have succesfully implemeted the twain in windows.now i have to do the same thing in mac side,when i am going to compile the same C++ source in mac side it gives errors,actually im using winnt.h winuser.h header files,so what can i use for these in mac..
thnxregards
Amila@amila123 wrote:
I have succesfully implemeted the twain in windows.now i have to do the same thing in mac side,when i am going to compile the same C++ source in mac side it gives errors,actually im using winnt.h winuser.h header files,so what can i use for these in mac..
You can’t just recompile your code for Mac. To support both OS’s, you’ll need to be very familiar with the TWAIN specification and both OS’s. All of the Windows operating system calls in your code need to be replaced/reworked to use Mac OS calls including all of your GUI implementation.
For example, Capability memory allocation on Mac uses NewHandle() while on Windows GlobalAlloc() is used. You’ll need to find these differences in your code and make the appropriate changes.
You might be able to share some code if you’re careful to isolate the OS calls but it may not be worth the extra effort.
I have implemented DS’s on both OS’s so I speak from experience.
–
Thnx for the reply.
can u plz sample source code for mac ..jst for load the library and open datasource..it’ll be a great help to me to continue my development
Regards
Amila@amila123 wrote:
…can u plz sample source code for mac ..jst for load the library and open datasource…
Are you implementing a Macintosh application or a Data Source?
In either case, study up on the TWAIN spec (search for Mac) and this Technical Note:
TWAIN Data Sources for Mac OS X
http://developer.apple.com/technotes/tn2002/tn2088.htmlApple provides sample code for a DS…
Sample DS
http://developer.apple.com/samplecode/SampleDS…but I couldn’t find sample code for an application. I’ve only implemented DS’s so I can’t help you there.
The DSM will be loaded automatically at load-time if you link it into your XCode project (app or DS). The DSM is a OS X framework located here: /System/Library/Frameworks/TWAIN.framework
Once you do that, you can simply #include the TWAIN.h header file (which is embedded in the framework) in you cpp files and make C function calls to the DSM.
By the way, don’t bother with the DSM provided by the TWG on twain.org. Apple includes the DSM framework with OS X 10.2 and later.
–
Hi..
Thnx again for the reply..
I have a java application in front end and have to do scanning using TWAIN.so i have to create a wrapper that can call by java.i have successfully implanted that part in Windows side.i want to implement that same thing in the MAC side.so I have already created a C++ project using XCODE and imlemented OPEN_DSM,OPEN_DS..I have included TwainFramework as well.
but when we run called the C++ library and run the native method OPEN_DSM it gives a error like
“autoreleased with no pool in place – just leaking”Can u give me a idea to solve this
Regards
AmilaaronThe Macintosh version of Code::Blocks for C++ relies on the Xcode distribution from Apple for its compiler. The installation is done in three separate parts for this reason. LX0-103 braindump
- AuthorPosts