communication b/w modeless dlg and its parent
-
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.
-
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.
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_
-
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_
-
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
Whats error?
_**
**_
WhiteSky