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. What is wrong in this piece of code...

What is wrong in this piece of code...

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • E Offline
    E Offline
    Exceter
    wrote on last edited by
    #1

    private: CButton Comps[5]; CRegKey reg; ....... (reg.Open(HKEY_LOCAL_MACHINE, "Software\\ShutDown") == ERROR_SUCCESS ) { reg.QueryDWORDValue("NumOfComputers", num); POINT pt1, pt2; pt1.x = 20; pt1.y = 20; pt2.x = 120; pt2.y = 50; ULONG Cname_sz; char buf[20]; CString cn, Cname; for (int i=0; i< maxComps; i++) { CRect tmpRect(pt1, pt2); LPCTSTR val = (LPCTSTR) itoa(i, buf, 10); int len = Cname.GetLength(); reg.QueryStringValue(val, (Cname.GetBuffer(len)), &Cname_sz); Comps[i].Create(_T(Cname), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, tmpRect, this, 1210+i); pt1.y += 30; pt2.y += 30; Cname.Empty(); } .........

    A 1 Reply Last reply
    0
    • E Exceter

      private: CButton Comps[5]; CRegKey reg; ....... (reg.Open(HKEY_LOCAL_MACHINE, "Software\\ShutDown") == ERROR_SUCCESS ) { reg.QueryDWORDValue("NumOfComputers", num); POINT pt1, pt2; pt1.x = 20; pt1.y = 20; pt2.x = 120; pt2.y = 50; ULONG Cname_sz; char buf[20]; CString cn, Cname; for (int i=0; i< maxComps; i++) { CRect tmpRect(pt1, pt2); LPCTSTR val = (LPCTSTR) itoa(i, buf, 10); int len = Cname.GetLength(); reg.QueryStringValue(val, (Cname.GetBuffer(len)), &Cname_sz); Comps[i].Create(_T(Cname), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX, tmpRect, this, 1210+i); pt1.y += 30; pt2.y += 30; Cname.Empty(); } .........

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      what is your problem with this piece of code? Don't try it, just do it! ;-)

      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