I have a problem using the mksCommand structure using the MKS C API. I am reaching the server via Source Integrity (2009, build: 4.10.0.9049), and the environment is setup correctly, most commands works flawlessly. My problem arose with the createsandbox command, but it should be the same with every other command that uses a parameter like that (ci, co, for example), but I haven't reached those yet in my implementation.
// This works fine
mksCommand actcmd = mksCreateCommand();
actcmd->appName = (wchar_t*) L"si";
string e = GetSBPath(); // obviously this is an inside look into a much more complex application, but it does work
actcmd->cmdName = (wchar_t*) L"viewsandbox";
mksOptionListAdd(actcmd->optionList, (wchar_t*) L"sandbox", wstring(e.begin(), e.end()).c_str());
mksResponse response = mksCmdRunnerExecCmd(cmdrunner, actcmd, INTERIM_CACHE);
etc.
However when I want to do the same for createsandbox, I have no clue how to use mksCommand for the last parameter, which would specify the sandbox directory. There is no "--sandbox" or "--directory" parameter, and the mksSelectionListAdd() and the mksOptionListAdd() commands both add the "--" automatically to the respective mksCommand parameter, as far as I know. Do I have an option to still use the mksCommand structure for this somehow, or do I need to 'fall back' to the wchar_t* array solution instead of the more structured approach?