Nemoticchigga 0 Junior Poster in Training

I am trying to read from a serial port using System::IO:: Ports in visual studio 2005. I can write fine, but reading isnt reading in anything to the buffer. I am using the following code, similar to the way i was writing to the port.

array<unsigned char>^ messageBuf = gcnew array<unsigned char>(512);
Rs232com->Open();
Rs232com->Read(messageBuf, 0, 512);
Rs232com->Close();

It goes past the read and detects something on the port, but does not fill messageBuf with anything. Any advice? Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.