minifiredragon
Programmer
Ok, this is more or less a continuation of the winsock question. Through looking over some working programs I have found that I needed to establish a pointer to the CICServerDoc class. All my work is being done in the CICServerView class since I have it linked into a database.
I searched through this forum and found something I thought might help me:
CICServerDoc * pPointer = (CICServerDoc*)GetParent();
CString testing = pPointer->m_test;
but it gives a badpointer error when I try to get the information from a variable in the CICServerDoc class. I know it is a basic question and it is probably somewhere in my brain, but for the life of me I can not figure out how transfer data back and forth between classes.
I had no problems with the classes I created (mostly dialog).
I did the follow:
CInsertDlg dlgInsert;
dlgInsert.m_strTest = test;//send a variable to another class)
dlgInsert.DoModal;
and if I wanted to get the variable later, I called:
mytest = dlgInsert.m_strTest;
But since I am not to clear on how the CICServerView was created, I don't have a clue to how to get a public variable from in, while in the CICServerDoc and vise versa.
I did a test with:
CICServerDoc * pPointer = (CICServerDoc*)GetParent();
CString testing = pPointer->m_test;
but set it up as an int, and stored 56 in it, and it passed only a 6. So I am now scratching my head. Once I get over this hurdle I think I am in the home stretch. I finsihed the 1st App I have been asking questions about earlier and it works better then I'd expected. I am now adding winsock support so it can exchange short, no more then 32 chars between 2 programs.
and if I ever wanted to
I searched through this forum and found something I thought might help me:
CICServerDoc * pPointer = (CICServerDoc*)GetParent();
CString testing = pPointer->m_test;
but it gives a badpointer error when I try to get the information from a variable in the CICServerDoc class. I know it is a basic question and it is probably somewhere in my brain, but for the life of me I can not figure out how transfer data back and forth between classes.
I had no problems with the classes I created (mostly dialog).
I did the follow:
CInsertDlg dlgInsert;
dlgInsert.m_strTest = test;//send a variable to another class)
dlgInsert.DoModal;
and if I wanted to get the variable later, I called:
mytest = dlgInsert.m_strTest;
But since I am not to clear on how the CICServerView was created, I don't have a clue to how to get a public variable from in, while in the CICServerDoc and vise versa.
I did a test with:
CICServerDoc * pPointer = (CICServerDoc*)GetParent();
CString testing = pPointer->m_test;
but set it up as an int, and stored 56 in it, and it passed only a 6. So I am now scratching my head. Once I get over this hurdle I think I am in the home stretch. I finsihed the 1st App I have been asking questions about earlier and it works better then I'd expected. I am now adding winsock support so it can exchange short, no more then 32 chars between 2 programs.
and if I ever wanted to