Variables
I must work on two classes and every time I must bring the content of a variable from a class to another .
CAddPointView
CQuantDlg
These are the two classes
In CAddPointView I have got the variable "c_uni",and in CQuantDlg I need it
I try to write this in a function of CQuantDlg:
CAddPointView *p; // get a pointer to CAddPointView class
CString cu=p->c_uni;
But the program goes in error whi?
Can you help me?
[481 byte] By [
elektroman] at [2007-11-18 13:41:45]

# 1 Re: Variables
CAddPointView *p; // get a pointer to CAddPointView class
This is a pointer to uninitialized memory, not a pointer to an instance of a CAddPointView class.
You likely want to do something like:
CAddPointView *p = GetPtrToTheViewClass();
CString cu=p->c_uni;
The implementation of GetPtrToTheViewClass is left to you.
Also - what is the type of CAddPointView::c_uni?
# 5 Re: Variables
Originally posted by vcstarter
Did you try to use the new operator?
I believe what vcstarter is getting at is that you could do something like:
CAddPointView *p = new CAddPointView;
CString cu=p->c_uni;
// ...
delete p;
Of course, this would imply that something has been done to put a worthy value into p->c_uni...