|
-
January 17th, 2016, 07:30 AM
#10
Re: pass variable value from one dialogbox to other/ one class to other class in vc++
 Originally Posted by 2kaud
Consider this very simple example
Code:
#include <iostream>
#include <string>
using namespace std;
template<typename T>
class A {
private:
T pa;
public:
A(T a) : pa(a) {}
T geta() const {
return pa;
}
void seta(const T& a) {
pa = a;
}
};
template<typename T>
class B {
private:
T pb;
public:
B(T b) : pb(b) {}
T getb() const {
return pb;
}
void setb(const T& b) {
pb = b;
}
};
int main()
{
A<string> a("This is A"s);
B<string> b("This is B"s);
cout << "a = " << a.geta() << ", b = " << b.getb() << endl;
b.setb(a.geta());
cout << "a = " << a.geta() << ", b = " << b.getb() << endl;
}
This displays
Code:
a = This is A, b = This is B
a = This is A, b = This is A
as the private variable of B has been set to that of A.
I want to perfom as I asked my previous question how to get text of selected item in list control
1] Select one iteam in list control
2] store it into variable
3] access that variable with it's containing value into other class (which I have to pass to SQLquery in code )
now just want to know that how pass that value and get into other class ?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|