Porting a Windows C++ Over to Mac OS X

Discussion in 'Mac Programming' started by ncmason, May 22, 2008.

  1. ncmason macrumors regular

    ncmason

    Joined:
    Feb 27, 2007
    #1
    Hello fellow developers,
    I recently volunteered to work on porting an already-made C++ Windows app to the Mac platform. I really would appreciate it if some people are willing to help me go about this as this is somewhat confusing for me.

    The project can be downloaded here:
    http://masonsklut.com/tooki.zip

    Thanks,
    Mason
     
  2. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #2
    What is it that you find confusing?
     
  3. ncmason thread starter macrumors regular

    ncmason

    Joined:
    Feb 27, 2007
    #3
    How to convert the files so they work as a Mac OS X app.
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    Well you just need to rewrite the Windows API calls to Mac OS X API calls. I'm assuming the Windows application was written using the Win32 API? If so it should be fairly straightforward to port it to Carbon but it might be worth the extra effort and try and get it to Cocoa.
     
  5. ncmason thread starter macrumors regular

    ncmason

    Joined:
    Feb 27, 2007
    #5
    Thanks for the suggestions. I'm a newbie to this stuff so I'll give it a try even though I'm not too sure about how to do all of this.
     
  6. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #6
    http://www.6speedonline.com/forums/showthread.php?t=128354&page=2

    It looks like a mac version is forthcoming. It might be best to contact those on this thread to see if you can help with this, as they appear to already working on this.

    The hardest part will be the bluetooth interaction. I'm confident that the windows API for accessing bluetooth is much different. It seems like for this application (Pair with Bluetooth device, push file to bluetooth device, disconnect) it's probably quicker to start from scratch than with a windows App.

    -Lee
     
  7. ncmason thread starter macrumors regular

    ncmason

    Joined:
    Feb 27, 2007
    #7
    I've already contacted the main guy at the bluetooth company. He started a thread for anyone who wants to help. So, I volunteered. If I started from scratch, would it be a do-able task for a novice? Any help would be greatly appreciated.
     
  8. tacoman667 macrumors regular

    Joined:
    Mar 27, 2008
    #8
    You will not be able to use C++ MFC at all in Mac. MFC is Windows based as AppKit is Mac based. You will be rewriting those into the AppKit framework as the previous poster suggested.

    What compiler did you use or was used to create the C++ application?
     
  9. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #9
    There are a few decision you have to make. The first one is if the code is to be split or if you are going to try and keep one set of files that build on both platforms, maybe by use of #if preprocessor statements. There are advantages both ways but a common code base would likely means quite a bit of restructuring to separate the GUI from the rest of the code.

    Maybe you could tell us what this software does and how big it is. How many source files and how many lines of code total?
     
  10. ncmason thread starter macrumors regular

    ncmason

    Joined:
    Feb 27, 2007
    #10

    The app uses your laptop's built-in bluetooth to find the Tooki (bluetooth phone adapter). When it finds it, it updates the firmware.

    The app size is 1 MB. It's very small.

    Thanks,
    Mason
     
  11. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #11
    The Tooki firmware I am assuming? What method does it use to update it? That sounds like you are going to need to work in the IOKit framework. Not 100% sure on that.
     

Share This Page