Page 1 of 1

Carbon API Calls in PureBasic

Posted: Sat Apr 14, 2007 10:03 pm
by DARKGirl
Hello everyone!

I am happy to report that PureBasic Alpha 1 works on my Intel (AMD) based computer. I'm not sure how it compiles and works beautifully, but I am not complaining. I have yet to test a lot of functions, but I will get to that as soon as I cross this roadblock.

How do I call Carbon API functions in PB? I found the Function here: http://developer.apple.com/documentatio ... TP30000176 ,but that doesn’t help much other than tell me the syntax. Please look at OpenDrawer.

Oh btw, I am going to attempt to write a chat client using mostly PB commands only and rely less on API commands. I wrote another Chat Client in Windows, but that code relies heavily on WinAPI, so I was not able to port any of it at all. My plan now is to design my applications so they will function with or without the API code...sort of like...standalone procedures that have been set in their own file (Include). I don't know why I didn't do it like this before. It would have saved me a lot of headache.

Thanks in Advance!

DARKGirl

Posted: Sat Apr 14, 2007 10:55 pm
by Fred
The easier choice is to use the "ImportC" statement, it should do the trick.