P
pkirk25
I have a program written in C++ with STL that does work. If I double
click on the executable, it examines a data source and write a report
to a file and writes useful messages to cout.
I want to be able to call this from another program, for example, a
GUI.
So I write a small test application that only calls the working
program.
When I run the test program, I can see from the on screen messages it
has successfully called the working application with correct arguments
and the working application is correctly reading the data. But this
routine does not run:
Table::Table(ifstream &src, vector<string> &realm_list)
{
realm_list = this->realm_list(src);
size_t i = 0;
ofstream out_file("tmp_realms.tbl", ios:
ut);
if (!out_file.is_open())
{
cout << "No file!!" << endl;
}
for (i = 0; i != realm_list.size(); ++i)
{
cout << realm_list << endl;
out_file << realm_list << endl;
}
out_file.close();
}
So if I call it directly it runs perfectly but if I call it from
another appliaction it does not run. And I can't work out how to debug
this to see where or why it fails.
Can anyone suggest a way forward?
click on the executable, it examines a data source and write a report
to a file and writes useful messages to cout.
I want to be able to call this from another program, for example, a
GUI.
So I write a small test application that only calls the working
program.
When I run the test program, I can see from the on screen messages it
has successfully called the working application with correct arguments
and the working application is correctly reading the data. But this
routine does not run:
Table::Table(ifstream &src, vector<string> &realm_list)
{
realm_list = this->realm_list(src);
size_t i = 0;
ofstream out_file("tmp_realms.tbl", ios:
if (!out_file.is_open())
{
cout << "No file!!" << endl;
}
for (i = 0; i != realm_list.size(); ++i)
{
cout << realm_list << endl;
out_file << realm_list << endl;
}
out_file.close();
}
So if I call it directly it runs perfectly but if I call it from
another appliaction it does not run. And I can't work out how to debug
this to see where or why it fails.
Can anyone suggest a way forward?