Hi,
We are providing a SDK for various compiler(s) and REALbasic 2006 being one
of them for Mac OS X 10.4.x platform
Below is the communication scheme:
Framework<=communicates-with=>Plugin<=communicates-with=>REALbasic
application
The REALbasic application communicates with the framework through a glue
layer implementation, This module exports the APIs and constants to
REALbasic in the form of a plugin.
In one of the API, we need to get structure information in our application
through one of the API exposed. So, we send the FTR Id as an input and
expect a structure in the output.
This is the structure defined
Typedef FTRInfO{
int LeftExecNum;
} SP_FTR_INFO,*SPP_FTR_INFO;
Below is the glue layer implementation for the same:
REALmethodDefinition Mymethods [] = {
{ (REALproc) Glue_GetFTRInfo, REALnoImplementation, "GetFTRInfo ( FTRID as
integer, FTRInfo as memoryblock) as integer"},
};
}
int Glue_GetFTRInfo( long FTRID,
REALmemoryBlock Glue_FTRInfo)
{
FTRInfo = (SPP_FTR_INFO)REALMemoryBlockGetPtr(Glue_FTRInfo);
return GetFTRInfo(FTRID,FTRInfo);
}
*GetFTRInfo returns address of the filled structure
We can pass the structure from glue application to REALbasic by wrapping
them into REALclass. Below are the structure properties and the
REALclassdefinition
######### #########
REALproperty MyProperties[] = {
{ "", "LeftExecNum", "Integer", REALconsoleSafe,
REALstandardGetter,REALstandardSetter,FieldOffset(SP_FTR_INFO,LeftExecNum) }
};
REALclassDefinition MyClassDefinition= {
kCurrentREALControlVersion,
"MyClass",
nil,
sizeof(SP_FTR_INFO),
0,
nil, // Initializer
nil, // Finalizer
MyProperties, // Properties
sizeof(MyProperties)/sizeof(REALproperty), // sizeof properties
nil, // Methods
0,
nil, // Events
0, // sizeof Events
nil, // Interfaces
nil,
0,
nil, // Constants
0, // sizeof constants
0,
};
######### #########
Now I try get the LeftExecNum field from this REAL Class definition in my
REALbasic application by
Dim exenum as MyClass.
And then use it as
exenum.leftExecNum
Which throws nilObjectException Error.
I am completely clueless.
So my query is :
a) Is the above procedure correct ? Can REALstandardGetter and
REALstandardSetter be used to get and set the values ?
b) How to get the value back from the wrapped class ? Why does it throw
nilObjectException. (Please note that I have already included it in try
catch block)
c) Is there any more easier / better way to achieve the same purpose ?
d) Any sample code explaining how to fetch the info in the REALbasic
application from the glue layer plugin will be of great help.
Please send your useful suggestions for the same.
Thanks and Regards,
Rohit Dhamija
--
View this message in context:
http://www.nabble.com/nilObjectException-Why-tf1993654.html#a5471492
Sent from the REALBasic - Plugins forum at Nabble.com.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>