problem with ListCtrl display
-
Hi guys,I have a question I used Access2000 to build a database,there is a Field named “Price”,it's type is money. In VC++ ,I used ADO to access this database. I wanna display the value of this field in my listctrl,the code as follow:
_variant_t Holder; CString str; Holder = theApp.m_pADOSet->GetCollect("Price"); if ( VT_NULL==Holder.vt ) str="N/A"; else str.Format("%.2f", Holder.dblVal); m_ListCtrl.SetItemText(i, 7, str);
listctrl display 0.00 in this field.but in my table,it's value is 3.00,could anyone tell me what I can do? thanks =============== YES, I am here. =============== -
Hi guys,I have a question I used Access2000 to build a database,there is a Field named “Price”,it's type is money. In VC++ ,I used ADO to access this database. I wanna display the value of this field in my listctrl,the code as follow:
_variant_t Holder; CString str; Holder = theApp.m_pADOSet->GetCollect("Price"); if ( VT_NULL==Holder.vt ) str="N/A"; else str.Format("%.2f", Holder.dblVal); m_ListCtrl.SetItemText(i, 7, str);
listctrl display 0.00 in this field.but in my table,it's value is 3.00,could anyone tell me what I can do? thanks =============== YES, I am here. ===============%f
is the format specifier for afloat
, use%lf
for adouble
. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt Laugh it up, fuzzball.