Conversion from java class object to struct *
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   hogwatz_wizard
Posted On:   Tuesday, April 3, 2007 10:20 AM

Hi all I have c++ code which requires data in unsigned char* format which it typecasts to struct*. The structures are as below :: struct A { unsigned char x; unsigned int y; }; struct B { struct A; unsigned char[][]; unsigned int; }; I need to pass data from java to fill up struct B for which i need struct A also. I tried passing Object array in byte format and also tried constructing java classes similar to structure and passing that after converting to bytes. The problem is data received at c++ end is all garbled. I need to pass data so that when c++ class type-casts it to struct * all fields are initia   More>>

Hi all


I have c++ code which requires data in unsigned char* format which it typecasts to struct*. The structures are as below ::


struct A {
unsigned char x;
unsigned int y;
};


struct B {
struct A;
unsigned char[][];
unsigned int;
};


I need to pass data from java to fill up struct B for which i need struct A also. I tried passing Object array in byte format and also tried constructing java classes similar to structure and passing that after converting to bytes.


The problem is data received at c++ end is all garbled. I need to pass data so that when c++ class type-casts it to struct * all fields are initialized properly.


Can anyone please suggest a solution ?


thankz
ashadh

   <<Less
About | Sitemap | Contact