You can try CContainedWindowT. Regards, Lirong
Li Lirong
Posts
-
WTL DDX with controls, really? -
stl and sprints/sscansHi, There is an article by Sutter on this issue. If you are interested, you can read it here: http://www.gotw.ca/publications/mill19.htm Also, there is an experimental c++ string format library (It is accepted by the boost organizers) : http://groups.yahoo.com/group/boost/files/format2/ Regards, Lirong
-
member functions vs. non-member functions>Not in the real world. Why? In his articles, Scott gave reasons for his argument --- non-member functions can improve encapsulation. If the reasons are valid, why it is not practical in the real world? If those reasons are not valid, why they are not? Regards, Lirong
-
member functions vs. non-member functionsHi, all, What's your opinions on Scott Meyers' article: How Non-Member Functions Improve Encapsulation In that article, he gave the following algorithm:
if (f needs to be virtual) { make f a member function of C; } else if (f is operator>> or operator<< ) { make f a non-member function; if (f needs access to non-public members of C) { make f a friend of C; } } else if (f needs type conversions on its left-most argument) { make f a non-member function; if (f needs access to non-public members of C) { make f a friend of C; } else if (f can be implemented via C's public interface) { make f a non-member function; } else { make f a member function of C; }
Do you agree with this algorithm? Regards, Lirong -
What's wrong with my code? (class template)Thank all.
;)
I have try it in C++ Builder. It runs well there.
I could have defined the function within the class declaration. However, I am not able to do that. The reason is illustrated by the following example. In the example, A<T>::nested uses B<T> and B<T>::nested used A<T>.
// begin of A.h
#pragma once// foreword declaration, but we still can not use class B.
//that is why I can't put the definition of A<T>::nested::test() inside the declaration;template <class T> class B;
template <class T> class A
{
public:
class nested
{
public:
void test(B<T> b);
};
nested GetNested() const
{
return nested();
}
}
#include A.imp
// end of A.h
<
-
_beginthread and MFCI would suggest you to read one of newcomer's articales: http://www.pgh.net/~newcomer/callbacks.htm ;) Lirong
-
What's wrong with my code? (class template)Thanks. ;) I have made some correctness on my question; Yes, If I write the definition of "test" of the nested class within the class declaration, it does work. So my question is: Is it possible to separate the definition and declaration of a function of a nested class ( which is nested in a template ). Is there anything wrong with my syntax? Or it is just because of the compiler(vc++6)? Thanks. Lirong
-
What's wrong with my code? (class template)I have the following codes, all of them are in the same file "test.cpp" //declaration template <class T> class temp { public: class nested { public: void test(); }; void test() { nested nes; nes.test(); } }; //definition template <class T> void temp<T>::nested::test() {} int main( /* int argc, char* argv[] */ ) { temp<int> tem; tem.test(); return 0; } error message: test.obj : error LNK2001: unresolved external symbol "public: void __thiscall temp<int>::nested::test(void)" (?test@nested@?$temp@H@@QAEXXZ) test.exe : fatal error LNK1120: 1 unresolved externals what's wrong with my code? thanks :(( Lirong