Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. problem with ListCtrl display

problem with ListCtrl display

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++databasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angel Kid
    wrote on last edited by
    #1

    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. ===============

    M 1 Reply Last reply
    0
    • A Angel Kid

      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. ===============

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      %f is the format specifier for a float, use %lf for a double. --Mike-- Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt Laugh it up, fuzzball.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups