winforms - Print Date and Time in a form C++ -


could fix me problem? have got text field in my form. , print date , time in string,i mean, cursor is.

i got class this:

#include <windows.h> //russian letters okay private: system::void времяИДатаtoolstripmenuitem_click(system::object^  sender, system::eventargs^  e) {       systemtime sys_t;     getsystemtime(&sys_t);     char szformat[] = "mmmm";     char buffer[16];     sys_t.wmonth = 1;      getdateformat(locale_user_default, 0, &sys_t, szformat, buffer, 256); } }; 

i use messagebox::show() , isn't problem? can give advice this?

thanks.

standard warning: while it's possible write main body of application in c++/cli, or write gui in c++/cli using winforms, not recommended. c++/cli intended interop scenarios: c# or other .net code needs interface unmanaged c++, c++/cli can provide translation between two. primary development, recommended use c# either winforms or wpf if want managed code, or c++ mfc if want unmanaged.

ok, said: you've got full .net library available you, why not use it?

void времяИДатаtoolstripmenuitem_click(object^ sender, eventargs^ e) {     datetime = datetime::now;     string^ datestring = now.tostring("mmmm"); } 

Comments