Mike Copeland
2009-10-23 23:58:52 UTC
Using VC++ 6.0...
How do I get SearchPath to work? This code compiles, but it doesn't
find the file "skel1.ect" that exists in one of the directories in the
Path. (The code executes and does return the Path string, but the
"sResult" variable doesn't get populated.) Please advise. TIA
DWORD err = GetEnvironmentVariable("PATH", NULL, 0);
char* path = new char[err+1]; path[err] = 0;
GetEnvironmentVariable("PATH", path, err);
err = SearchPath(path, "skel1", ".ect", 0, NULL, NULL);
char* sResult = new char[err+1]; sResult[err] = 0;
err = SearchPath(path, "skel1", ".ect", err, sResult, NULL);
How do I get SearchPath to work? This code compiles, but it doesn't
find the file "skel1.ect" that exists in one of the directories in the
Path. (The code executes and does return the Path string, but the
"sResult" variable doesn't get populated.) Please advise. TIA
DWORD err = GetEnvironmentVariable("PATH", NULL, 0);
char* path = new char[err+1]; path[err] = 0;
GetEnvironmentVariable("PATH", path, err);
err = SearchPath(path, "skel1", ".ect", 0, NULL, NULL);
char* sResult = new char[err+1]; sResult[err] = 0;
err = SearchPath(path, "skel1", ".ect", err, sResult, NULL);