Click here to Skip to main content
14,735,834 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have created following object of SYSTEMTIME which has attributes like wDay, wMinute, wHour etc which are WORD...


I want to print s_t.wDay or s_t.wHour in DataGridView column( i.e type System::String). So i get error like "cant convert WORD to System::String"
So i tried to convert
1)WORD to char* then
2)char* to System::String but doing some mistake..plz help

my code is
dataGridView1->Rows[0]->Cells[0]->Value=????? (here i want s_t.wDay )
i tried with _ultoa for conversion WORD to char*.. but dont know how to do that..
Updated 18-May-11 3:41am

1 solution

The best way is to use a function that will format the details, such as String::Format[^].
fjdiewornncalwe 18-May-11 10:07am
Agreed. +5.
Joan M 18-May-11 10:19am
agree 5.
Niklas L 18-May-11 11:38am
It does make life easier. Fived.
Sergey Alexandrovich Kryukov 18-May-11 15:50pm
Correct (...or ToString, or some combination), my 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900