So basically I am working on converting a C# project to C++. And i am confused on how the beginning of the C# project works, it has the following code in it, and I am trying to make this C++ compatible, but I can't seem to find where the arguments are being passed through? I am just running the compiled exe file....Also am using Microsoft Visual 2010
static void Go(string[] args)
{
// call function above to find the game directory and store it in _gameDirectory
_gameDirectory = FindGameDirectory();
if (args.Length == 1)
{
if (args[0].Equals(@"addasm"))
{
AddAsmToRootPatchFile();
return;
}
/* if (args[0].Equals(@"test"))
{
PatchAllDrs();
return;
}*/
if (args[0].Equals("createpatches"))
{
// locates the file age2_x1.exe
var allExes = FindFiles(@"AoK-TC executables", @"age2_x1*.exe", null, null);
// create new emtpy list of string format to find any extra patch files
var allPatchedExes = new List<string>();
// finds any other already patched files in the directory.
try
{
allPatchedExes = new List<string>(FindFiles(@"Patched executables", @"age2_x1*_???*x???*.exe", null, null));
}
catch (FatalError)
{
// Happens if no patched exes are found. No problem!
}
// allExe's is the actual game exe
foreach (var exe in allExes)
{
// if other patched file contains the original exe inside of its list skip it
// and continue to the next exe in allExes
if (allPatchedExes.Contains(exe))
{
UserFeedback.Trace(@"Skipping patched exe '{0}'", exe);
continue;
}
// if it is not found in the already patched files, create a new patched file y converting it
ConvertPatchFile(exe);
}
}
// Generates errror
else
{
ShowUsage();
}
return;
} // end if if statement
// initialize new width and height as 0
int newWidth = 0, newHeight = 0;
// Some value if true or false may show showUsage();
switch (args.Length)
{
case 0:
break;
case 2:
{
if (!int.TryParse(args[0], out newWidth) || !int.TryParse(args[1], out newHeight))
{
ShowUsage();
return;
}
}
break;
default:
ShowUsage();
break;
}