Click here to Skip to main content
15,118,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Everyone,

I am currently involved in a Project With MFC Application Property Pages:
I have two property Pages, I wanted to call the member varibale of the first property page inside the second Property Pages.
I have not much experience in the Programming Field.
Below is the example of which I am trying to do. If anyone has an idea on the same, Kindly revert. It would be a great help!!

What I have tried:

CPropertyPageA:

CString m_A; // memeber variable of Property Page A Edit Control Box


CPropertyPageB:



ButtonClick()
{

CString B;
CPropertyPageA PageA;
B= PageA.m_A.GetString(); // I need to store the value from the edit controlin to the
ctring B, While clicking on the Button on the Property PageB

}
But , I am getting Error with Link. Iam stuck at this point and not able to move forward?
Posted
Updated 27-Oct-20 4:47am
Comments
Richard MacCutchan 27-Oct-20 9:30am
   
"I am getting Error"
And like so many posters here, you fail to tell us what the error is, or where it occurs.
jojos learning club 27-Oct-20 9:38am
   
@Richard MacCutchan Actually there is no compilation error, But the string is not copied to this variable, Thats what I meant by error

1 solution

I could be wrong, but at a guess the following line is not correct in your ButtonClick function:
C++
CPropertyPageA PageA;

You are creating a new property page object and assuming that it will refer to the existing one. But this is a different object to any page created elsewhere.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900