How do I Convert Struct to ByteArray in .net 2005
Managed C++/CLI
2
Posts
2
Posters
0
Views
1
Watching
-
All I need to do is to send a structure via SerialPort Control which needs in return an array of Bytes, and then convert it back on the other side! Can anyone help me here :( I am getting pretty desperate here :(( Thanks
Hello, you might want to give the BinaryFormatter class a try. It allows you to serialize and deserialize objects to and from a stream. As far as i know you could then retrieve the buffer from it or even write the stream to the serial port. You will find it in this namespace: System::Runtime::Serialization::Formatters::Binary; Anyway, I cannot guarantee that it will actually work, because i haven't had the time yet to test it by my own. Best regards Tobias