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. Assigning a member variable...

Assigning a member variable...

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
2 Posts 1 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.
  • R Offline
    R Offline
    RuiSantiago
    wrote on last edited by
    #1

    Hi! I've just created a button by code, and i would like to have in the same class where it has been created, its control member variable, what i have is : botao->Create("Cancel", WS_CHILD|WS_VISIBLE, CRect(10, y+120, 60, y+170), this, 1232123); I use this ast argumento to give it a name and then i edited Resource.h and write : #define IDNB_TESTE 1232123, 'assigning' that id number to a name, which i would use in DDX: DDX_Control(pDX, IDNB_TESTE, m_teste); then i tried to use the m_teste variable, but i kept receiving errors, what ave i done wrong? How can i do this? Thank you for your time

    R 1 Reply Last reply
    0
    • R RuiSantiago

      Hi! I've just created a button by code, and i would like to have in the same class where it has been created, its control member variable, what i have is : botao->Create("Cancel", WS_CHILD|WS_VISIBLE, CRect(10, y+120, 60, y+170), this, 1232123); I use this ast argumento to give it a name and then i edited Resource.h and write : #define IDNB_TESTE 1232123, 'assigning' that id number to a name, which i would use in DDX: DDX_Control(pDX, IDNB_TESTE, m_teste); then i tried to use the m_teste variable, but i kept receiving errors, what ave i done wrong? How can i do this? Thank you for your time

      R Offline
      R Offline
      RuiSantiago
      wrote on last edited by
      #2

      I found it, i had just to had BS_PUSHBUTTON and process the ON_BT_CLICKED message with the id i had chose to the function. Thank you the same

      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