We have a project bringing c++ code from windows to Macintosh. All code was compiled and released under windows XP, so I am told.
Some peculiarities are surfacing, and I need help understanding how to change some things. As background, I am very new to c++, having programmed exclusively in Pascal since 1977.
Please note that I am using the term "Xcode" to mean the Xcode C++ compiler. If this list is not appropriate for this list, please direct me to the correct list.
In the examples below, some of the fields have been removed for clarity or changed to avoid disclosing confidential stuff.
(1) How should fields declared as HGLOBAL be declared as on Macintosh? I have tried "handle" but Xcode complains (why???). Tried uint32, which allowed compilation to continue, BUT, it feels wrong. Example:
typedef struct TheData { unsigned int ID; int size; HGLOBAL hTheData; HGLOBAL hTheHeader; HGLOBAL hTheGains; } TheData;
(2) This struct appears to be a class, Xcode objects to "public:" of course, as it is not declared as a class. How should this be declared on Xcode? (extra credit - how did the microsoft compiler pass this?)
typedef struct TheDataHeader { int iHeaderSize; int iVersion; int iDatFileNumber;
public: void ReadFromStr(unsigned char * str); void WriteToStr(unsigned char * str); void ReadFullHeaderFromStr(unsigned char* str); } DATAHeaderV1;
(3) Last (at the moment), Xcode objects (pun intended) to this class.
class McsFile : public CFile { int HeaderSize; int VerNo; unsigned int ID;
public: virtual void SetTheSizeOfStuff(int Size); virtual int GetSomeStuff(const char* FileName, TheData* mData); int GetSomeStuff(const char* InfoStr, int BufferSize, TheData* mData); int GetHeaderStuff(const char* InfoStr, int BufferSize, TheData* mData); };
Whether or not you can help, thanks to all for your time looking at this.
Gary |