Debugging when one program calls another

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::eek: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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top