我正在this repo之后编写DolphinDB的插件,我想传递一个用户定义的函数,如下所示:
在cpp中:
Access to XMLHttpRequest at 'http:...' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field x-token is not allowed by Access-Control-Allow-Headers in preflight response.
在DolphinDB脚本中:
extern "C" ConstantSP funcInCpp(Heap* heap, vector<ConstantSP>& arguments);
如何正确执行此操作?
答案 0 :(得分:0)
您的脚本没有任何问题。在您的插件代码中,请将ConstantSP强制转换为FunctionDefSP。