[vtkusers] About vtkPoints::InsertPoint()
John Drescher
drescherjm at gmail.com
Thu Apr 26 10:22:59 EDT 2012
On Thu, Apr 26, 2012 at 10:04 AM, Wenlong <scc.wwl at gmail.com> wrote:
> Hi, David & Robert
>
> Thank you very much for your reply.
>
> Robert,
>
> Yes, I use x[2] = 3. That was a mistyping.
>
> David,
>
> I call vtkPoints->InsertPoint(1, x) without SetNumberOfComponents() in my
> previous application with Windows Vista & Visual Studio 2008 on another PC.
> It works. But as I call it in my current application with Windows 7 & Visual
> Studio 2008, the error pops up. I'm not sure if this is caused by different
> OS.
>
> A demo code #1 is like this
>
> {
> vtkPoints* points = vtkPoints::New();
> float x[3];
> x[0] = 0;
> x[1] = 1;
> x[2] = 2;
> points->InsertPoint(0, x); //where the access conflict happens
> }
>
> Another demo code #2 is
>
> {
> vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
> reader->SetFileName("C:\\Users\\Wenlong\\Desktop\\surface.vtk");
> //where the access conflict happens
> reader->OpenVTKFile();
> reader->Update();
> }
>
> The same access conflict happens when the vtkGenericDataObjectReader
> instance try to get to the .vtk file. I check the file and it does exist and
> it is not occupied by any other program.
>
> I don't understand why this is happening cause I set the including
> directories and libraries as necessary.
>
These both point to a botched VTK install. Again could you be mixing
debug and release in the same application. You can not safely install
release vtk dlls then compile your application for debug and try to
have your application use the release vtk dlls.
John
More information about the vtkusers
mailing list