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. extern variable

extern variable

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 Posts 3 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.
  • D Offline
    D Offline
    durban2
    wrote on last edited by
    #1

    MFC, STUDIO 2008, MDI There are into project some global variable created same method Last ‘m_gsADDRESSHOM’ can’t to create. extern CString m_gsADDRESSHOM; // set into file stdafx.h // modeldlg2.cpp : implementation file #include "stdafx.h" #include "modeldlg2.h" CString m_gsADDRESSHOM; // CMainDlg2 dialog Using global variable pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM); // error C2039: 'm_gsADDRESSHOM' : is not a member of 'CMainDlg2'

    S T 2 Replies Last reply
    0
    • D durban2

      MFC, STUDIO 2008, MDI There are into project some global variable created same method Last ‘m_gsADDRESSHOM’ can’t to create. extern CString m_gsADDRESSHOM; // set into file stdafx.h // modeldlg2.cpp : implementation file #include "stdafx.h" #include "modeldlg2.h" CString m_gsADDRESSHOM; // CMainDlg2 dialog Using global variable pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM); // error C2039: 'm_gsADDRESSHOM' : is not a member of 'CMainDlg2'

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      durban2 wrote:

      Using global variable

      durban2 wrote:

      dlg7.m_gsADDRESSHOM

      It's a global variable - that means it's not a member of dlg7, so don't treat it as if it were. Do you think you maybe need to read an introductory C++ text[^], to learn these basics?

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      1 Reply Last reply
      0
      • D durban2

        MFC, STUDIO 2008, MDI There are into project some global variable created same method Last ‘m_gsADDRESSHOM’ can’t to create. extern CString m_gsADDRESSHOM; // set into file stdafx.h // modeldlg2.cpp : implementation file #include "stdafx.h" #include "modeldlg2.h" CString m_gsADDRESSHOM; // CMainDlg2 dialog Using global variable pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM); // error C2039: 'm_gsADDRESSHOM' : is not a member of 'CMainDlg2'

        T Offline
        T Offline
        ThatsAlok
        wrote on last edited by
        #3

        durban2 wrote:

        pEdit_ADDRESS->SetWindowTextW(dlg7.m_gsADDRESSHOM);

        try using like this :- pEdit_ADDRESS->SetWindowTextW(m_gsADDRESSHOM);

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
        Never mind - my own stupidity is the source of every "problem" - Mixture

        cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

        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