Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualizackp

Posted 23 January 2013 - 07:33 AM

I have a function like this:

 

asIScriptObject* ComponentScripted::getProperty(const std::string &key) const 

 

and I'm registering it like this:

 

r = engine->RegisterObjectMethod(strComponent, "?& get(const string &in) const", asMETHODPR(ComponentScripted,getProperty,(const std::string&) const,asIScriptObject*), asCALL_THISCALL); assert( r >= 0 );

 


However, it doesn't seem like ?& is a valid return type. How would I return a asIScriptObject back to the script from c++?

 

Any help would be greatly appreciated. Thank you.


#2izackp

Posted 23 January 2013 - 07:33 AM

I have a function like this:

 

asIScriptObject* ComponentScripted::getProperty(const std::string &key) const 

 

and I'm registering it like this:

 

 

 

r = engine->RegisterObjectMethod(strComponent, "?& get(const string &in) const", asMETHODPR(ComponentScripted,getProperty,(const std::string&) const,asIScriptObject*), asCALL_THISCALL); assert( r >= 0 );

 


However, it doesn't seem like ?& is a valid return type. How would I return a asIScriptObject back to the script from c++?

 

Any help would be greatly appreciated. Thank you.


#1izackp

Posted 23 January 2013 - 07:32 AM

I have a function like this:

 

asIScriptObject* ComponentScripted::getProperty(const std::string &key) const 

 

and I'm registering it like this:

 

 

 

r = engine->RegisterObjectMethod(strComponent, "?& get(const string &in) const", asMETHODPR(ComponentScripted,getProperty,(const std::string&) const,asIScriptObject*), asCALL_THISCALL); assert( r >= 0 );

 


However, it doesn't seem like ?& is a valid return type. How would I return a asIScriptObject back to the script from c++?

 

Any help would be greatly appreciated. Thank you.


PARTNERS