void MyFunction(int arg1, float arg2, const char* arg3) { CLR_RT_StackFrame* stackFrame = GetStackFrame(); // Get the current stack frame // Access the argument values and information CLR_RT_HeapBlock& arg3Value = stackFrame->Arg3(); CLR_DataType arg3Type = arg3Value.DataType(); int arg3Index = stackFrame->ArgIndex(2); }
void AnotherFunction(short arg1, double arg2) { CLR_RT_StackFrame* stackFrame = GetStackFrame(); // Modify the argument value and return it to the caller CLR_RT_HeapBlock& arg1Value = stackFrame->Arg1(); arg1Value.SetInteger((int)arg1 * 2); CLR_RT_HeapBlock& arg2Value = stackFrame->Arg2(); arg2Value.SetDouble(arg2 + 1.0); stackFrame->SetResult(); // Set the return value }This example shows how to modify the first and second arguments in a CLR function and set the return value. Package library: Microsoft.SPOT.Native.