VTK 7.1.1:vtkX3DExporter异常

时间:2017-07-28 04:35:24

标签: c++ vtk

我使用vtkX3DExporter导出字符串,但是当我调用GetOutputString()时会出现异常。

写入文件成功但写入字符串不是。

我正在使用VS2017,我的构建目标是x64 dll。另一个exe导入这个dll并测试它如下:

// ... codes ...

exporter->SetFileName("D:\\TestFolder\\cccccccc.x3d");

exporter->Write(); // Writes to file successfully 

exporter->WriteToOutputStringOn(); // Turns On "WriteToOutputString"

exporter->GetWriteToOutputString(); // Returns 1

exporter->GetOutputStringLength(); // Returns 0

exporter->GetOutputString(); // Exception here. 

我无法捕捉到这个异常(我不知道为什么。我使用了try和catch块但我的exe只是崩溃了)所以我不知道细节。

1 个答案:

答案 0 :(得分:0)

好的,我找到了答案。在尝试获取输出字符串之前,我应该调用exporter-> Update()。