Problem in Accessing CStringArray object,
-
Hi All, I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class. Atul
-
Hi All, I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class. Atul
There should be no problem doing this. It sounds like your CStringArray may have been delete before the second access. Is it a member variable of an object that's gone out of scope or did you create it on the stack?
Nothing is exactly what it seems but everything with seems can be unpicked.
-
Hi All, I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class. Atul
Do you want to access CStringArray on the other dialogs?
-
Hi All, I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class. Atul
Atul23 wrote:
But when i access it in other class...
How?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hi All, I am using CStringArray object to store the strings in array. I used this object in one class where i add strings in to CStringArray object. I want to access this object in other class. But when i access it in other class it gives me garbage values. So how can i access it in another class. Atul
-
I have a program that have a lot of dialogs and so a lot of butons. I wanna use my own button in all the dialogs, but I don't want to add a variable for each button on dialogs. I wnat to do it in just one piece of code, something like this : (in InitDialog())
CWnd* pWnd = GetWindow(GW_CHILD); while(pWnd) { if(pWnd->GetRuntimeClass() != RUNTIME_CLASS(CButton)) ;// - change them to CMyButton pWnd = pWnd->GetWindow(GW_HWNDNEXT); }
-
I have a program that have a lot of dialogs and so a lot of butons. I wanna use my own button in all the dialogs, but I don't want to add a variable for each button on dialogs. I wnat to do it in just one piece of code, something like this : (in InitDialog())
CWnd* pWnd = GetWindow(GW_CHILD); while(pWnd) { if(pWnd->GetRuntimeClass() != RUNTIME_CLASS(CButton)) ;// - change them to CMyButton pWnd = pWnd->GetWindow(GW_HWNDNEXT); }
Hadi Dayvary wrote:
...but I don't want to add a variable for each button on dialogs.
Why not?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to
the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Hadi Dayvary wrote:
...but I don't want to add a variable for each button on dialogs.
Why not?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to
the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
because there are more than 500 buttons in the project and they are growing, If there is a better way I like to use it. I think Professional UI use that way.
-
because there are more than 500 buttons in the project and they are growing, If there is a better way I like to use it. I think Professional UI use that way.
It would take all of 10 seconds to change all references from
CButton
toCMyButton
using search/replace in the IDE. You've spent 100 times that just looking for a solution, let alone implementing one.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
It would take all of 10 seconds to change all references from
CButton
toCMyButton
using search/replace in the IDE. You've spent 100 times that just looking for a solution, let alone implementing one.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
DavidCrow wrote:
It would take all of 10 seconds to change all references from CButton to CMyButton using search/replace in the IDE. You've spent 100 times that just looking for a solution, let alone implementing one.
thats what we call.. a great reply!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
Never mind - my own stupidity is the source of every "problem" - Mixturecheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You