Hi All,
I have a build an application which uses file names from a directory.
to get these file names I used the following code from MSDN.

FILE * fp;
String *extension;


// Create a reference to the current directory.
DirectoryInfo* di = new DirectoryInfo("C:\Sachin");
// Create an array representing the files in the current directory.
FileInfo* fi[] = di->GetFiles();
//Console::WriteLine(S"The following files exist in the current directory:");
// write the names of the files in the current directory.
Collections::IEnumerator* myEnum = fi->GetEnumerator();
fp = fopen("nest.lst","w+");
while (myEnum->MoveNext())
{
FileInfo* fiTemp = __try_cast<FileInfo*>(myEnum->Current);
//Console::WriteLine(fiTemp->Name);
extension = Path::GetExtension(fiTemp->Name);


fprintf(fp,"%s\t%s\n",fiTemp->Name,extension);
}


fclose(fp);

this code works using
#using <mscorlib.dll> with /clr option.
but i fail to run this application on another machine that doesnt have visual studio installed. As i dont how to specify this dll at run time.
thanks in advance for any help
sachin

Try compiling it in Rlease mode. It should'nt look for the DLL then.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.