Porting Windows programs

ggeorgiev2001

Registered
Hello MAC gurus!

I would like to ask a (sully) question on area I haven't touched yet (and don't know whether to start from)

I will probably get a project to port several Windows programs (Borland CBuilder, MS Visual C++) to MAC OSX. The decision whether to start it depends on some questions:
- I do know (a lot) about UNUX (SVR4), Linux etc, but haven't done any (serious) developmment yet
- I do (probably) write some stuff on Windows, MS VC and sort of
- The most tricky part. The project requires intensive RS232 communications. I do know there are USB-RS232 converters (Apple site even endorses some), but what about development side of this? Do we have full stty on those ports?
- Are there any development tools bundled with OSX? Do they deserve attention, or we have to look somewhere else (where?)?

Thanks for your help,

George
 
Yes, there are excellent development tools bundled with Mac OS X. The compiler is gcc, the debugger is gdb. Coming from Unix you should feel quite comfortable with these tools. Apple's front-end for gcc/gdb is ProjectBuilder, and they include a visual development tool called InterfaceBuilder as a companion for building interfaces and creating class prototypes.

Yes, you can use C and C++ on Mac OS X, although the recommended method of writing GUI-based applications is to use either Objective-C or Java. You can accomplish a lot by writing a simple GUI in Objective-C and implementing the meat of your program through shell scripts, apple scripts, perl scripts, python scripts, and/or discreet executables. As with any Unix everything can communicate with and invoke everything else.

You shouldn't have a hard time finding information about implementing USB-serial conversion. If the device has a 9-pin connector you can just use a 9-pin to USB dongle. Apple's site contains pretty thorough documentation of their USB/HID libraries, but you may have to Google around a bit more to find specifics on dealing with the dongle.

Mac OS X handles most of its devices through a POSIX implementation, and in fact this is how devices that add serial ports to the Mac expose themselves. However, USB devices are special and are not automatically exposed through POSIX file handles for obvious reasons. For these you will need to learn about USB and possibly HID, and you will doubtless need to learn the IOKit as well.
 
Using POSIX is OK so long you don't assume file paths are constant, since they aren't. This isn't a problem when programming tools for UNIX gurus, but Mac users expect apps to know where files are when they are moved. Thus file primitives at runtime ought to be NSDocuments or FSRefs and AliasHandles when persistent.

It isn't in the Aqua HI Guidelines yet, but it ought to be (not all Mac conventions are in that guide for some reason).
 
Back
Top