I need a very simple alert box like NSRunAlertPanel(), but this is for a C++ embedded 64-bit app and I don’t know Cocoa nor Objective-C.
Any ideas on how to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Option A
One solution would be to look at the
CFUserNotificationAPIs.Option B
Another option would be to wrap
NSRunAlertPanel, using CoreFoundation types as parameters:If you want a C symbol, name the file MONNSRunAlertPanel.m (objc), and alter the header accordingly,
If you want it as a C++ symbol, just name the file MONNSRunAlertPanel.mm (objc++).
Assuming you’re using the default compiler setting, our source will be compiled based on its file extension.
Finally, add Foundation and AppKit to link to the necessary system libraries.
Then you can call MONNSRunAlertPanel without dragging Foundation.framework into your C++ sources (because CFString and NSString types are bridged).