[Martenlist] external structure access problem
Adrian Wirz
awirz at scout-systems.ch
Fri Sep 29 12:08:33 EDT 2006
I have finally succeeded in integrating a dynamic library into a
framework. After some tests it seems to run pretty well (finally). The
main problem was linking the dynamic library with a non-standard name
in Xcode 1.5 which seems to be rather reluctant to find such a library
when linking.
Now there are a few problems regarding access to external structures.
Here is one:
The following declaration run through the C tool yields the subsequent
result:
typedef unsigned char st32[32];
typedef struct IDRec {
st32 StationName;
st32 UserName;
st32 UserPass;
st32 TaskName;
Boolean isapi;
Boolean unused;
} IDRec;
After running through the C tool:
VPL_ExtField _IDRec_6 = {
"unused",129,1,kUnsignedType,"NULL",0,0,"unsigned char",NULL};
VPL_ExtField _IDRec_5 = {
"isapi",128,1,kUnsignedType,"NULL",0,0,"unsigned char",&_IDRec_6};
VPL_ExtField _IDRec_4 = { "TaskName",96,32,kPointerType,"unsigned
char",0,1,NULL,&_IDRec_5};
VPL_ExtField _IDRec_3 = { "UserPass",64,32,kPointerType,"unsigned
char",0,1,NULL,&_IDRec_4};
VPL_ExtField _IDRec_2 = { "UserName",32,32,kPointerType,"unsigned
char",0,1,NULL,&_IDRec_3};
VPL_ExtField _IDRec_1 = { "StationName",0,32,kPointerType,"unsigned
char",0,1,NULL,&_IDRec_2};
VPL_ExtStructure _IDRec_S = {"IDRec",&_IDRec_1};
I cannot access the string fields in IDRec from within Marten (build
056.00g006) with the following code:
-------------- next part --------------
The code is executed alright but when I retrieve the fields again they
contain nothing or garbage. So I asked myself whether the computed type
(kPointerType) of the fields is correct? Or is the way I access the
fields not correct?
I'd be very happy about some help here. Thanks.
Regards Adrian
++++++++++++++++++++++++++++++++++++
+ Adrian D. Wirz, SCOUT Systems
+ Software Development and Systems Support
+ CH-5615 Fahrwangen
+ Tel +41(0)56/670'10'51
++++++++++++++++++++++++++++++++++++
---> "The difference between genius and stupidity is that genius has
its limits."
---> Anonymous ;-)
More information about the Martenlist
mailing list