【发布时间】:2018-01-04 00:27:43
【问题描述】:
我正在使用 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 只是崩溃了)所以我不知道细节。
【问题讨论】: