Hi, i need help I want to create a code that will generate a message box. The code must also b compatible with Linux and Mac. I have a code but it only can work in Windows. #include <stdio.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <unistd.h> #include <windows.h> using namespace std; int main() { const char *filePath = "C:\\WINDOWS\\system32\\spool\\drivers32\\ss.mf"; char *msg; if(remove(filePath) != 0) { msg = "Uninstallation Unsuccessful, Please Contact Admin"; MessageBox(NULL, msg, "Msg", MB_OK | MB_ICONERROR); } else { msg = "Uninstallation Successful"; MessageBox(NULL, msg, "Msg", MB_OK | MB_ICONINFORMATION); } return 0; } Code (markup): Can someone help me, pls? I really need this. Thanks in advance
OK, so the biggest problem here is that you are not using standard C++: you're using MS Visual C++. Without reverting to things like emulators for the other OS', you will need to use a cross-platform GUI library instead. Off the top of my head, there's one called wxWidgets you should be able to use...
Thanks for the reply Ooo, so sorry. I'm a novice in C++ I found out that code from internet and i modified it accordingly. Can you tell me what's the standard C++ GUI library for displaying message box? Or i must use wxWidget to do it? Thanks
Standard C++ has no window GUI support: you need to use some form of GUI library to do it. wxWidgets is just one of those libraries, but it was the first one to come to mind.
As "sea otter" said you can use QT for development of GUI in cross platform environment. It provides best widgets and excellent library commands. And ya, it is now NOKIA subsidiary, not trolltech.
I also give my first preference to wxWidgets. Fast Light Toolkit is also a good and free option as it supports UNIX/Linux(X11), Windows and MacOS X.