Hello Mike,
in your approach you want to modify a member of the device object directly from the native code by assing to it a new string. Accessing the members of objects is possible, but not the recommended way. Better is to use local variables to exchange the values. For example:
var string someValue = "";
// In native code receive some values via local variables
native ( someValue )
{
someValue = EwNewStringAnsi("TEST");
}
// The recommended approach: access the object members only from Chora
Application::Device.WIFI_Scan_SSID[c-1] = someValue;);
When you compile the code, you will see in the resulting C code, that the assignment to the variable WIFI_Scan_SSID is accompanied by additional function call EwRetainString() or EwShareString(). This function call tracks the usage of the string so when the string is not needed anmore, the string is released. Without this function call, the string is released early and unpredictably causing the variable WIFI_Scan_SSID to refer to some invalid memory. This is then detected and the 'Unmanaged string' error is reported.
Does it help you?
Best regards
Paul Banach