継承できるなら、ATL式に、 template<class T> class CMySocket : public class T{ ... GetSafeHwnd(), } class CUseSocketWnd : public CMySocket< CWnd > {}; とか、 template<class T> class CMySocket{ ... static_cast<T*>(this)->GetSafeHwnd()... } class CUseSocketWnd : public CWnd , public CMySocket< CUseSocketWnd > {}; するとかどうよ?
>605 // In general, CWnd objects should be passed by HWND from // one thread to another. The receiving thread can wrap // the HWND with a CWnd object by using CWnd::FromHandle. // // It is dangerous to pass C++ objects from one thread to // another, unless the objects are designed to be used in // such a manner.