[vtkusers] Problem with reading files

dedoel deeel at tlen.pl
Fri Aug 6 10:33:33 EDT 2010


Hi, I got a problem with reading files in some VTK library, so I wanted to
test if simple application where I only read file works... And I got the
same exception as earlier.

Unhandled exception at 0x63f5bd58 in test.exe: 0xC0000005: Access violation
reading location 0xcd07c83f.


This is my short, test application : 




#include <vtkSmartPointer.h>
#include <vtkDirectory.h>

#include <vtksys/SystemTools.hxx>

int main (int argc, char *argv[])
{

	vtkstd::string inputDirectory = argv[1];
	vtkSmartPointer<vtkDirectory> directory =
vtkSmartPointer<vtkDirectory>::New();

	int opened = directory->Open(inputDirectory.c_str());

	if(opened)
    {
    
		int numImages = directory->GetNumberOfFiles();

		for (int i = 0; i < numImages; i++)
		{
		vtkstd::string filename = directory->GetFile(i);
		vtkstd::string ext =
vtksys::SystemTools::GetFilenameLastExtension(filename);

		}
	}
}


The exception occurs in the line :

vtkstd::string ext =
vtksys::SystemTools::GetFilenameLastExtension(filename);

Any ideas?

Dawid

-- 
View this message in context: http://vtk.1045678.n5.nabble.com/Problem-with-reading-files-tp2266699p2266699.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list