Re: How to Call Objective C Object from C++ code



In article <1143784817.800849.152730@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"Mopelee" <kingdry_cn@xxxxxxxxxxx> wrote:

Hi, guys:

i prepare to build UI of program by cocoa.
but in order to make a portable program, some low level code sould
write in C++. then i must find some way to call Apple Service or
Objective C from C++.
Could anyone tell me a way to do that.

In general you just make the call to the objective-C method.

However you do need to make sure that the source code is being compiled
as objective-C or objective-C++ for this to work. That's automatic for
a ".m" or ".mm" file, otherwise you can change the language used in the
project settings.

--
Tom "Tom" Harrington
Macaroni, Automated System Maintenance for Mac OS X.
Version 2.0: Delocalize, Repair Permissions, lots more.
See http://www.atomicbird.com/
.