ruofeng.hu Posted October 28, 2010 Share Posted October 28, 2010 Is it possible to make use of windows API in our project?(like DCB structure) How to set up the compile environment? Link to comment
Guest extaliones Posted October 28, 2010 Share Posted October 28, 2010 Please, compile the project using SCons because we check all of the options for each file and for the included and referenced libraries. Link to comment
frustum Posted October 28, 2010 Share Posted October 28, 2010 Could you please provide us more details on what are you trying to achieve? Link to comment
ruofeng.hu Posted November 4, 2010 Author Share Posted November 4, 2010 Thank you for answering. And how could UnigineScript get return data(value) from external function of exported user defined class? Link to comment
Guest extaliones Posted November 9, 2010 Share Posted November 9, 2010 You can use Variable type or any build in type (float,int). Please, see the following sample: Samples/Api/Functions/Function.cpp /* */ Variable my_sum(const Variable &v0,const Variable &v1) { if(v0.getType() == Variable::INT && v1.getType() == Variable::INT) { Log::warning("my_sum(%d,%d): called\n",v0.getInt(),v1.getInt()); return Variable(v0.getInt() + v1.getInt()); } if(v0.getType() == Variable::STRING && v1.getType() == Variable::STRING) { Log::warning("my_sum(%s,%s): called\n",v0.getString(),v1.getString()); return Variable((std::string(v0.getString()) + "+" + std::string(v1.getString())).c_str()); } Log::warning("my_sum(%s,%s): called\n",v0.getTypeName(),v1.getTypeName()); return Variable("unknown"); } 1 Link to comment
Recommended Posts