Click here to Skip to main content
15,913,944 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to convert??? Pin
Ravi Bhavnani7-Apr-04 1:25
professionalRavi Bhavnani7-Apr-04 1:25 
GeneralRe: how to convert??? Pin
don7cry7-Apr-04 18:17
don7cry7-Apr-04 18:17 
GeneralStrange Visual C++ behavior - Computationally heavy app. Pin
Indrawati6-Apr-04 17:27
Indrawati6-Apr-04 17:27 
GeneralRe: Strange Visual C++ behavior - Computationally heavy app. Pin
Maxwell Chen6-Apr-04 17:29
Maxwell Chen6-Apr-04 17:29 
GeneralRe: Strange Visual C++ behavior - Computationally heavy app. Pin
cmk6-Apr-04 21:13
cmk6-Apr-04 21:13 
QuestionHow to use CDataGrid Pin
yingkou6-Apr-04 17:08
yingkou6-Apr-04 17:08 
QuestionLPPICTUREDISP -- CPictureHolder --- How to release memory? Pin
SNathani6-Apr-04 13:12
SNathani6-Apr-04 13:12 
Generaluse of template class and operator-> Pin
tparry6-Apr-04 11:43
tparry6-Apr-04 11:43 
I am new to (attempting) to use template classes.
My requirement is to avoid coding using inheritance - becuae I have 13 classes already coded and I want to have two "new forms" of classes that "inherit" this class and another class. To clarify...
I have a class X and I wish to make a class publishedTrack and a class reflectedTrack.
For example: I was hoping to use
typedef PublishedObject< Track > PublishedTrack ;
PublishedTrack* publishedTrack = new PublishedTrack;

where
template < class T >
class PublishedObject
{
private:
p_;

public:
PublishedObject();
virtual ~PublishedObject();

operator T*(void) { return p_; }
T& operator*(void) const { return *p_; }
T* operator->(void) const { return p_; }

PublishedObject& operator=(PublishedObject<t> &p_)
{ return operator=((T *) p_);}
PublishedObject& operator=(T* p_)
{ p = p_; return *this; }

T* get() const { return (T*)p_; };
}

I also want to be able to do publishedTrack->someMemberFunctionInTrack()

But what I get is that my operator overloading of -> is not quite right.
Any advice...any "pointers" ?
GeneralRe: use of template class and operator-&gt; Pin
Guido Loupias7-Apr-04 3:29
Guido Loupias7-Apr-04 3:29 
QuestionX10 C/C++ API? Pin
Ravi Bhavnani6-Apr-04 11:11
professionalRavi Bhavnani6-Apr-04 11:11 
AnswerFound it! Pin
Ravi Bhavnani6-Apr-04 12:44
professionalRavi Bhavnani6-Apr-04 12:44 
QuestionCString to DWORD ? INT ? Pin
LudaLuda6-Apr-04 11:11
LudaLuda6-Apr-04 11:11 
AnswerRe: CString to DWORD ? INT ? Pin
Ravi Bhavnani6-Apr-04 11:16
professionalRavi Bhavnani6-Apr-04 11:16 
GeneralRe: CString to DWORD ? INT ? Pin
LudaLuda6-Apr-04 11:26
LudaLuda6-Apr-04 11:26 
GeneralRe: CString to DWORD ? INT ? Pin
Ravi Bhavnani6-Apr-04 11:31
professionalRavi Bhavnani6-Apr-04 11:31 
AnswerRe: CString to DWORD ? INT ? Pin
avenger_sb256-Apr-04 11:49
avenger_sb256-Apr-04 11:49 
GeneralRe: CString to DWORD ? INT ? Pin
Prakash Nadar6-Apr-04 15:31
Prakash Nadar6-Apr-04 15:31 
GeneralCListCtrl - Highlighting all of the selected row Pin
mmica6-Apr-04 10:59
mmica6-Apr-04 10:59 
GeneralRe: CListCtrl - Highlighting all of the selected row Pin
Ravi Bhavnani6-Apr-04 11:06
professionalRavi Bhavnani6-Apr-04 11:06 
Generalclipped controls Pin
pgiustinoni6-Apr-04 6:37
pgiustinoni6-Apr-04 6:37 
GeneralRe: clipped controls Pin
avenger_sb256-Apr-04 7:27
avenger_sb256-Apr-04 7:27 
GeneralShowWindow problem Pin
reznod6-Apr-04 6:09
reznod6-Apr-04 6:09 
GeneralRe: ShowWindow problem Pin
Prakash Nadar6-Apr-04 7:02
Prakash Nadar6-Apr-04 7:02 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 7:35
reznod6-Apr-04 7:35 
GeneralRe: ShowWindow problem Pin
reznod6-Apr-04 7:47
reznod6-Apr-04 7:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.