Hello, I'm coming from a Windows background and I want to start an app I developed for my "main" application to start, but in order for the app I want to start to work correctly I have to pass string command line arguments.
Here is how I thought passing command line argument would have worked.
My Application.app "InputFile.txt" "outputFile.txt" "1"
I tried using things such as this command such as 'open', but it keeps thinking I'm opening more then one file and I was thinking I could just use a working command I get going off the terminal into the system command.
I also have tried the fork and execv example from the cplusplus.com for starting executables, but I get these errors:
I'm guesting it's because I'm using a higher level API such as wxMac that is causing those errors.
Here is my source code too:
Thank you for reading my post.
Here is how I thought passing command line argument would have worked.
My Application.app "InputFile.txt" "outputFile.txt" "1"
I tried using things such as this command such as 'open', but it keeps thinking I'm opening more then one file and I was thinking I could just use a working command I get going off the terminal into the system command.
I also have tried the fork and execv example from the cplusplus.com for starting executables, but I get these errors:
Code:
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
Break on __THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC__() to debug.
I'm guesting it's because I'm using a higher level API such as wxMac that is causing those errors.
Here is my source code too:
Code:
char *my_args[6] = {"MyApp.app", "InputFile.txt", (char*)SavePath.c_str(), "1", NULL};
pid_t pid;
switch ((pid = fork())) {
case -1:
cout << "Fork Error!" << endl;
break;
case 0:
execv("MyApp.app", my_args);
default:
cout << "This is a message from the parent!" << endl;
break;
}
Thank you for reading my post.