Confusedguy
Programmer
Alright... I'm looking absolutely everywhere in MSDN to try and figure this out... but to no avail. I'm trying to get the current time in my Windows Forms Application. All the code I find, doesn't work. I tried this snippet I found in MSDN:
char timebuf[128];
_strtime_s(timebuf);
NOW:
how do I display this in a label on my form?!?! i tried
this->lblShutdownInit->Text = timebuf;
but i get an error:
Form1.h(249) : error C2664 : 'void System:: Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'car [128]' to 'System::String ^'
No user-defined-conversion operator available, or Cannot convert an unmanaged type to a managed type
so it can't convert from char to System::String. So I tried changing Char to System::String, and i still get errors. I'm learning C++, but I have no idea if Visual C++ has different ways of doing things or what... but shouldn't that work??
char timebuf[128];
_strtime_s(timebuf);
NOW:
how do I display this in a label on my form?!?! i tried
this->lblShutdownInit->Text = timebuf;
but i get an error:
Form1.h(249) : error C2664 : 'void System:: Windows::Forms::Control::Text::set(System::String ^)' : cannot convert parameter 1 from 'car [128]' to 'System::String ^'
No user-defined-conversion operator available, or Cannot convert an unmanaged type to a managed type
so it can't convert from char to System::String. So I tried changing Char to System::String, and i still get errors. I'm learning C++, but I have no idea if Visual C++ has different ways of doing things or what... but shouldn't that work??