Event::getProperty seems to be working fine for me if I create an integer or floating point user property, but returns garbage if I make a text property.
I’ve tried this in C# (and native C++, just to make sure it wasn’t a .NET interop issue). The C# is as follows ("objectName" is the name of the text property I created in Designer. It’s 8 characters long.):
[code:335owfr1]IntPtr prop = Marshal.AllocHGlobal(256);
result = ev.getProperty("objectName", prop, false);
string pName = Marshal.PtrToStringAuto(prop);
When I view the memory location at prop after the getProperty call, it’s a few byes of null-terminated junk. Same gibberish ends up in pName after that call.
Now, if I switch the property to an int and update the code accordingly, it works just fine.
This is on 4.17.01.
- kirkus asked 8 years ago
- You must login to post comments