handling byte array in c++
Posted on 2002-07-21
I have a c++ dll (pure c++, no MFC support) which is called by a vb program. vb program creates,populates and passes a user-defined structure to the c++ dll. The dll acts on this data, in turn populates some more values in the structure and returns it to vb. The user-defined structure is very large (atleast 40000bytes) and has many sub structures, strings, arrays. On compilation of vb this is giving me a "Too many local, non-static variables" error. MSDN says this is a vb bug and information should be passed as a byte array and gives an example of how this is to be done. Now my problem is receiving this byte array, extracting data from it so that it populates the corresponding structure on c++ side, and returning it again as a byte array. Hitherto I have used CByteArray which did most of the work for me. But how to do it in pure c++? Experts please advise.