怎么在C++插件中运行一个rhino指令

我按照网上的教程编写了程序,但是出现了如下错误,为什么。Running Rhino Commands from Plugins with C/C++ https://developer.rhino3d.com/guides/cpp/running-rhino-commands-from-plugins/
系统w7,Microsoft Visual Studio2017 ,rhino6
image

将:
RhinoApp().RunScript(L"_-Line 0,0,0 10,10,10", 0)
换成:

CRhinoScriptContext s = CRhinoScriptContext();
s.SetScript(L"_-Line 0,0,0 10,10,10");
RhinoApp().RunScript(s);

就可以了。

谢谢,按照你的方法可以成功运行了