Carbon's HTML rendering library not showing images

I am working on porting an old program that uses an embedded browser using the HTML Rendering library from Carbon. I am migrating it from codewarrior to Xcode, using the 10.4 SDK. The HTML page is displayed correctly, including links but images don't show up. I can see the alt content, and dimensions are properly set with the width and height fields.

Yes it does not look too complicated to me, however, I can't get the Cocoa view in my Carbon app. WebView and WebFrame are both defined in WebView.h and I am getting plenty of conflicts when I try to include that file. I am reading about Cocoa-Carbon integration, but getting either deprecated material or things relevant to the 10.5+ SDK, and I am using the 10.4 SDK (I have to).

Where do the errors originate? Usually if errors are coming from within a framework's header, the build window will show the file in your code where the #include/#import originated.

Can you post the code for the .h/.m files? Which version of Xcode are you using?

Click to expand...

I found that in my project, I was forcing files to be compiled in C++, that's why it could not compile my objective-c file although is was sourcecode-objc type. The problem is that when I changed my project to compile files depending on their type, I am getting thousand of errors in my own code (or the code I should make my own). It might be because my .h files are all set as c header files, I am trying to change them as c++ header files without much success so far...

I finally managed to have things working... well I can't see the web page yet, but it is just a matter of getting to know how to use the webkit API as the app compiles and links successfully.

In case it can help other people, here were the issues:

. My app was set to be compiled in C++, so even .m files would be compiled in c++. After changing "Compile source as" from "C++" to "according to file type", I would then have thousand of error because of my precompiled headers being compiled in C. The solution was to include the header files inside a "#if defined __cplusplus". Apparently the reason is that the compiler will attempt to compile the precompiled header both in C and C++, and you don't want them to be compiled in C.

. In the header file for the loadURL function, you need a extern "C" directive if compiled in C++ because C++ would mangle the names, not objective C.

MacRumors attracts a broad audience
of both consumers and professionals interested in
the latest technologies and products. We also boast an active community focused on
purchasing decisions and technical aspects of the iPhone, iPod, iPad, and Mac platforms.