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. communication b/w modeless dlg and its parent

communication b/w modeless dlg and its parent

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
4 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.
  • G Offline
    G Offline
    GANsJob
    wrote on last edited by
    #1

    Hi all, In an SDI APP i am using a modeless dlg. I am creating the dlg in view class. In view class im using a LinkList . Now the Problem is i need to access the LinkList from the dlg . while Accessing the LinkList fn(append, del,...) I got an run time access violation and then the application terminates. How to resolve this problem. any body knows... by GAN.

    _ 1 Reply Last reply
    0
    • G GANsJob

      Hi all, In an SDI APP i am using a modeless dlg. I am creating the dlg in view class. In view class im using a LinkList . Now the Problem is i need to access the LinkList from the dlg . while Accessing the LinkList fn(append, del,...) I got an run time access violation and then the application terminates. How to resolve this problem. any body knows... by GAN.

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      Try passing a pointer of your application to the dialog. In the dialog you can create a pointer of your parent class and access the variables/member functions of the parent class with the help of that pointer. You can do this: in the dialog declare a pointer of view in the header file CMyParentView *pView; Now when you are creating the dialog CMydialog* pMyDlg=new CMyDialog(); pMyDlg->pView=this; pMyDlg->DoModal(); // Or in whatever manner you are creating the dialog. In the dialog you can then access the member variables of the view like pView->myLinkedList.///////Somecode or function here Try this.

      Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

      G 1 Reply Last reply
      0
      • _ _AnsHUMAN_

        Try passing a pointer of your application to the dialog. In the dialog you can create a pointer of your parent class and access the variables/member functions of the parent class with the help of that pointer. You can do this: in the dialog declare a pointer of view in the header file CMyParentView *pView; Now when you are creating the dialog CMydialog* pMyDlg=new CMyDialog(); pMyDlg->pView=this; pMyDlg->DoModal(); // Or in whatever manner you are creating the dialog. In the dialog you can then access the member variables of the view like pView->myLinkedList.///////Somecode or function here Try this.

        Somethings seem HARD to do, until we know how to do them. ;-)_AnShUmAn_

        G Offline
        G Offline
        GANsJob
        wrote on last edited by
        #3

        thank you for suggession when including view.h in dlg.h it got some error so i shifted mylinklist to doc class now it workes well thank u once again for ur reply

        H 1 Reply Last reply
        0
        • G GANsJob

          thank you for suggession when including view.h in dlg.h it got some error so i shifted mylinklist to doc class now it workes well thank u once again for ur reply

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Whats error?

          _**


          **_

          WhiteSky


          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