system
(system)
September 8, 2016, 8:03am
1
hi all,
i’m trying write a value on a xojo.core.dictionary
example below doesn’t work, how create a Auto type with the sdk ?
void
write_dic(REALobject dic) // dic is xojo.core.dictionary
{
REALobject (*fp)(REALobject,REALtext,REALtext) = NULL;
fp = (REALobject (*)(REALobject,REALtext,REALtext))REALLoadObjectMethod(dic,"Value(key As Auto, Assigns newValue As Auto)");
REALtext a,b;
a = REALBuildText("mykey",5,"MacRoman");
b = REALBuildText("myval",5,"MacRoman");
if (fp != nil)
{
fp(dic,a,b);
}
}
Eli_Ott
(Eli Ott)
September 8, 2016, 8:26am
2
Maybe this: the function pointer should not be defined to return a REALObject.
Well, I don’t think the Plugin SDK exposes auto functions.
So you can’t create an auto value.
As we have a function REALNewVariantText, I assume text is not an object.
If you call a function returning an auto object, you will notice that it is not a regular pointer as far as I remember.
I also made a request for auto data type.
Eli_Ott
(Eli Ott)
September 8, 2016, 10:10am
8
Auto is not a data type. As far as I understand it you just use REALobject.
If you declare a plugin function with parameter “x as auto”, you get something, but you will notice it may not work with REALLockObject.
Eli_Ott
(Eli Ott)
September 8, 2016, 11:25am
10
Just noticed that too while playing around with Auto in a test plugin.
Please add yourself to case 45158.
oh, there is one already: 37330
Auto is a data type and it’s definitely not a REALobject. Treating it as such might appear to work some of the time, but it’s not actually a REALobject and you will get crashes.