Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
How to launch a URL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to launch a URL?



Hi everyone,

How does one determine the users homepage and launch the url in their default browser? I was able to do this in classic, but now, in X i get bad_access... and im not sure what to do....

the code I am trying to use:


BOOL GetHomePage(Str255 str){
OSStatus err;
ICInstance inst;
ICAttr junk = 0;
err = ICStart(&inst, '????'); // Use your creator code if you have one!
if (err == noErr) {
// err = ICFindConfigFile(inst, 0, nil); this line doesn't work in Carbon
if (err == noErr) {
//Get the Home Page
err = ICGetPref(inst, kICWWWHomePage, (unsigned long*)junk, (void*)str, (long*)sizeof(Str255));
if ( err != noErr){
return false;
}
return true;
}
(void) ICStop(inst);
}
return (err);
}



I get bad_access on ICGetPref. hummmmMMmmm... what to do what to do......

-Morgan
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.