Convert Structure to String in VB.Net
Posted on 2004-10-19
I am in the process of converting a VB6 program to vb.net. This program build data in a structure; converts the structure to a string; tables the restulting strings in a string array; sorts the array; and then converts the strings back to a structure for additional processing. I guess the goal here is to build an array of sorted structures. The conversion to a string is just for sorting. The strings are also logged in a file.
If I went with an array of structures, the sort routine would have to be reprogrammed to handle sorting structures (and would probably be very slow). Thus, if I could continue with the VB6 theory of converting the structures to strings, the sort could remain as is. In VB6, the conversion from structure to string is using the CopyMemory API. This API did not convert properly and I am having trouble figuring out how to convert the API to .net. In addition, if I could get rid of that API, I would like to do that.
Does anyone have any advice on what I should do here? Any help will be appreciated.