you must have something else wrong because your function compiled ok for me. All I did was make it a simple function and declare the vector globally.
#include <iostream>
#include <string>
#include <io.h>
#include <vector>
using namespace std;
vector<string> m_vFilenames;
int MakeList(string p_sPath)
{
cout << "Parameter: " << p_sPath << endl;
struct _finddatai64_t struct_filedata;
string s_filename = p_sPath + "\\*.*";
string s_current = ".";
string s_parrent = "..";
cout << "Listing " << s_filename << endl;
long nHandle = _findfirsti64(s_filename.c_str(), &struct_filedata);
if(nHandle >= 0)
{
while(_findnexti64(nHandle, &struct_filedata) == 0)
{
if(struct_filedata.attrib & _A_SUBDIR)
{
if( (s_current.compare(struct_filedata.name) && s_parrent.compare(struct_filedata.name)) )
{
s_filename = p_sPath + "\\" + struct_filedata.name;
cout << "Subdir found: " << s_filename << endl;
MakeList(s_filename);
}
else
{
cout << "Dir found: " << struct_filedata.name << endl;
}
}
else
{
cout << "File found: " << struct_filedata.name << endl;
m_vFilenames.push_back(struct_filedata.name);
}
}
}
else
{
cout << "Path not found." << endl;
return -1;
}
return 1;
}
int main()
{
}
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.