Only C/C++ code that have seen the declaration of a structure may access
contents of it - if you don't play with type casts and claims that a
variable is of a different type.
Yuor library must export accessor functions that will read or write
attributes of variables of the hidden data type.
One library function can return a handle or a void pointer to a variable
of the hidden struct. Other library functions can take the handle or void
pointer and create a pointer of correct type and then perform operations.
/pwm
On Mon, 9 Jun 2008, Xetro Pulsar wrote:
> Hi List,
>
> I have this qn.
>
> I am using a complex library and need to modify one of its files. I include
> the library files with standard #include, those files then in turn include
> other files as required.
>
> Now, I am declaring a structure in the original .cpp file........lets say
> test.cpp and trying to access it through the library file. But quite clearly
> compiler doesnt allow it.
>
> Now how do I declare the structure in the original .cpp file using some
> namespace and access it through the library file?
>
> Please lemme know if I am not clear. I will update the question to make it
> more clear.
>
> Thanks & Regards,
> Xetro
>
|