Hi all,
Have coded in a few differant languages but still have heaps to learn, however I have recently been delving into Winsock programming and I want to do a simple thing, that is display an objects contents that has been passed from one server form to a client form
On one form I did "Winsock1->SendData("Hello") " and on the next I did in a data arrival event
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
private: System::Void Winsock1_DataArrival(System::Object^ sender, AxMSWinsockLib::DMSWinsockControlEvents_DataArrivalEvent^ e) {
//Object ^myObjArray;
Object ^t;
Winsock1->GetData(t);
// o = (String^)t;
//textBox1->Text = "test";
// array ^D1 = static_cast<array^>(t);
//String ^ar =<String^> t;
//array<Object^>^myArr = t;
label3->Text = "t is:"+t->ToString();
}
};
}
|
I have used the debugger and inside Object ^t the data is there however I just cant get a textbox to display the data, sure I can get it to say data arrived but not show3 the string in the object variable, well actually debug shows the object contents as a System::array with all data there.
I come from a background of standard C and the more I devlved into why I was having problems the more I ended up in this quagmire of complexity pertaining to new style casting and system objects vs standard objects as well as managed vs native code, could someone aid me to do this simple thing? I realise I should probably have some kind of incomming buffer but I am planning to just see this working an am debating whether I should look into other ways of handling sockets (Very new to socket programming)
I even did what I thought was casting Object ^t to a String ^ but when I do this, even though it builds and runs ok , well during debug the newly created String ^ shows the text but the form label1->Text = "value is"+t doesnt even run in this one instance? No error, but also no label text adjustment to what I want to print, just a blank label
This has been driving me absolutely bonkers lol any help you guys can provide is appreciated, I have been checking the msdn for about 1 week solid and there is no code piece that works with exactly what I am needing to do
Im quite surprised that printing the contents of an object to a label in net is so tough
Completely stumped!