S
Senthil
Hi,
I am using a COM component in C# client. The COM component has a method
which accepts an unallocated structure pointer. The method allocates memory
and returns filled up strcuture array. The method exceutes properly but when
the structure array is read in C# it does not return the filled in value
instaed gives garbage values..... I am not able to identify the reason for
this. Is there any link that could put more light on this?
Thanks for the help.
Sample Code:
The COM IDL conatins the structure definition.The strcuture has some enum
members.
typedef enum MY_STATUS
{
SUCCESS=100;
FAILURE=0;
}
struct MY_DATA
{
MY_STATUS s;
int size;
}
void Fill(MY_DATA ** pdata);
This method when called in C# client looks like this
void Fill(Intptr pdata)
Using StructuretoPtr a Intptr is created and passed.
Using PtrtoStructure the returned data is read. This does not return the
desired value.
I am using a COM component in C# client. The COM component has a method
which accepts an unallocated structure pointer. The method allocates memory
and returns filled up strcuture array. The method exceutes properly but when
the structure array is read in C# it does not return the filled in value
instaed gives garbage values..... I am not able to identify the reason for
this. Is there any link that could put more light on this?
Thanks for the help.
Sample Code:
The COM IDL conatins the structure definition.The strcuture has some enum
members.
typedef enum MY_STATUS
{
SUCCESS=100;
FAILURE=0;
}
struct MY_DATA
{
MY_STATUS s;
int size;
}
void Fill(MY_DATA ** pdata);
This method when called in C# client looks like this
void Fill(Intptr pdata)
Using StructuretoPtr a Intptr is created and passed.
Using PtrtoStructure the returned data is read. This does not return the
desired value.