is it possible to call CarbonFramework or even C?

Coding Questions, IDE related or anything else

is it possible to call CarbonFramework or even C?

Postby udo.killermann » Sat Apr 17, 2010 11:49 am

the question says it all ;)
I would like to call some functions of the IOHID family. Since these are pure C declerations (example below) and there is such a thing as toll free bridging between Cocoa and Carbon for certain data types, I am wondering if such things are possible without implementing a Cocoa helper class in Objective-C.
Code: Select all
Boolean HIDBuildMultiDeviceList(const UInt32 *inUsagePages, const UInt32 *inUsages, int inNumDeviceTypes)


Thanks for your help again
Udo
--------------
MacBook (2GHz, 4 GByte) - Lion (10.7.3)
started Objective Basic coding in April 2010 - still enjoy it ;-)
udo.killermann
 
Posts: 247
Joined: Thu Apr 08, 2010 6:46 am
Location: Hannover, Germany

Re: is it possible to call CarbonFramework or even C?

Postby berndnoetscher » Mon Apr 19, 2010 12:50 pm

udo.killermann wrote:the question says it all ;)
I would like to call some functions of the IOHID family. Since these are pure C declerations (example below) and there is such a thing as toll free bridging between Cocoa and Carbon for certain data types, I am wondering if such things are possible without implementing a Cocoa helper class in Objective-C.
Code: Select all
Boolean HIDBuildMultiDeviceList(const UInt32 *inUsagePages, const UInt32 *inUsages, int inNumDeviceTypes)


Thanks for your help again
Udo


Well, support for this would be possible. But there need to be more declare statements:
Code: Select all
Declare Framework "IOKit" optionalbinarypath, optionalheaderpath
Declare Lib "clib" optionalbinarypath, optionalheaderpath

would allow the following declare
Declare Function "IOKit" Boolean HIDBuildMultiDeviceList( const UInt32 *inUsagePages, const UInt32 *inUsages, int inNumDeviceTypes );

Will add these feature in the next version. It will be difficult to handle all those possible new data types...

berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am

Re: is it possible to call CarbonFramework or even C?

Postby berndnoetscher » Wed Aug 04, 2010 7:24 pm

It is possible to include objc code and frameworks now, so it is possible to call carbon code as well.
berndnoetscher
Site Admin
 
Posts: 280
Joined: Fri Feb 20, 2009 11:58 am


Return to Objective-Basic (Xcode 3)

Who is online

Users browsing this forum: No registered users and 2 guests

cron