Until a very recent OSX security patch, I had a method that worked just fine:
void ShowWebPage(CStdString WebPage)
{
CFStringRef URL = CFStringCreateWithCString(NULL, WebPage.c_str(), kCFStringEncodingASCII);
CFURLRef pathRef = CFURLCreateWithString( NULL, URL, NULL );
if( pathRef )
{
LSOpenCFURLRef(pathRef, NULL);
CFRelease(pathRef);
}
CFRelease(URL);
}
Now this no longer works. I also found this article: C++ OS X open default browser Which gives pretty much the same soliton. I also tried the first system("open URL") answer and that did not work either.
I had a Mac that had been off for a while and our app worked fine, then it got the latest patches and now this no longer works.
I have also tried googling this and I can only come up with objective C stuff.
Anyway, does anyone know how to open a web page from a cpp app now? I think there may be some kind of security setting that is blocking this, but I have no idea what it would be.