# Help on Custom Compiled Commands

**URL:** https://forum.highend3d.com/t/help-on-custom-compiled-commands/61041
**Category:** Xsi
**Tags:** developers
**Created:** [January 9, 2003, 10:47am UTC](https://forum.highend3d.com/t/help-on-custom-compiled-commands/61041 "2003-01-09T10:47:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mchatter](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/m/dc4da7/32.png) [@mchatter](https://forum.highend3d.com/u/mchatter)
#### Post date: [January 9, 2003, 10:47am UTC](https://forum.highend3d.com/t/help-on-custom-compiled-commands/61041/1 "2003-01-09T10:47:08Z")

</div>

Hi there!

I am making my very first steps into the realm of C++ coded Custom Compiled Commands.

In your XSI installation under " XSI\_3.01XSISDKexamplesSimpleCommandcpp " there is the project for a simple Custom Compiled Command.

This one I managed to compile and register.

Now I would also like to know how to pass back a return value to XSI. And I don't seem to get that right.

The method has a parameter called io\_retVal but I just don't seem to be able to "use" it properly.   
When i try to assign a value to it it compiles properly but this value does never arrive in the XSI script editor where the Command got called.

Here is the UNCHANGED source code fragment of the example:

//---------------------------------------------------------------------- --------------------------------

XSI::CStatus XSIOnCommandCPP   
(  
 const XSI::CString& in\_strCmdName, // name od the command  
 XSI::CValueArray& in\_array, // array of arguments   
 XSI::CValue& io\_retVal // return value   
)   
{  
 Application app;

app.LogMessage( L"Executing command: " + in\_strCmdName );

for (long i=0; i \< in\_array.GetCount(); i++)   
 {   
 app.LogMessage( L"Arg " + CValue(i).GetAsText() + L" = " +  
 in\_array.GetAsText() );   
 }

return CStatus: ![](http://www.highend3d.com/boards/style_emoticons/<#EMO_DIR#>/ohmy.gif)K;

}   
//---------------------------------------------------------------------- --------------------------------

Any help appreciated...

Martin

---

<div class="post-metadata">

### Author: ![oliverj](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/o/c77e96/32.png) [@oliverj](https://forum.highend3d.com/u/oliverj)
#### Post date: [February 7, 2003, 7:26am UTC](https://forum.highend3d.com/t/help-on-custom-compiled-commands/61041/2 "2003-02-07T07:26:35Z")

</div>

Take a look at:  
[http://www.xsibase.com/cgi-bin/yabb/YaBB.c...;num=1029116005](http://www.xsibase.com/cgi-bin/yabb/YaBB.c...;num=1029116005)  
Might help.
