Link to home
Start Free TrialLog in
Avatar of Saakar
Saakar

asked on

converting byte array from C++ to vb udt (Careful padding)

I am receiving byte array from C++ source.
I would want to convert it into VB udt

Because of padding issue in VB 6.0 i am unable to read in vb udt.
any solution
Saakar
Avatar of EDDYKT
EDDYKT
Flag of Canada image

do you create that c++?

if you do, make sure in c++

Project->properties->c/c++ tab, Category->code generation

change struct memeber alignment to 1 byte and recompile
sorry in vb they pad with 4 bytes, so change it to 4 bytes
by the way, i usually use 1 byte from c++ and then use copy memory on vb to extract the info one at the time instead of copy to udt
Avatar of Saakar
Saakar

ASKER

I am already doing that, I a just wondering if there is a easy api to diretly convert it into DWORD (??) or VB UDT format.
ASKER CERTIFIED SOLUTION
Avatar of EDDYKT
EDDYKT
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial