Re: bringing windows c++ code to Macintosh
Re: bringing windows c++ code to Macintosh
- Subject: Re: bringing windows c++ code to Macintosh
- From: M Pulis <email@hidden>
- Date: Wed, 10 Sep 2008 08:19:40 -0700
Thanks, Ken,
We are using the later suggestion, except just a pointer to avoid
handles.
Also simplifying the implementation as a bonus.
Gary
On Sep 10, 2008, at 7:24 AM, Ken Thomases wrote:
On Sep 10, 2008, at 6:52 AM, M Pulis wrote:
What is the difference between ".m" and ".mm" files? A .m file can
not access C++ code?
A .m file is Objective-C, and .mm is Objective-C++. So, correct,
a .m file can't include C++ code (even indirectly in the headers it
#includes).
You need to examine what those HGLOBAL fields are being used for
(their semantics, not their syntax), research what the
appropriate alternative would be to achieve similar semantics in
the Mac API(s) that you've chosen, and then rework the code in
terms of those new Mac APIs. It is never going to be as simple
as just declaring the same fields with different type. You may
not need those fields, you may need different fields, you may
need more fields or fewer -- it requires redesign.
Of course, yes, that was the case in my other porting projects. In
the case of the fields I am looking at they appear to be simple
pointers to pointers to globally allocated blocks of memory, much
like having an opaque handle as a field in a record.
If you're just looking for a data type which is a handle (pointer
to pointer), then you might use Handle. At this point, Handle is
archaic. It dates back to classic Mac OS (pre-Mac OS X) and isn't
used much by modern Mac APIs.
You might also just use a void** or YourCustomType**.
Regards,
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden