Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionShell_NotifyIcon :: Balloon (HOWTO) Pin
Programm3r13-Apr-07 2:59
Programm3r13-Apr-07 2:59 
AnswerRe: Shell_NotifyIcon :: Balloon (HOWTO) Pin
_AnsHUMAN_ 13-Apr-07 3:27
_AnsHUMAN_ 13-Apr-07 3:27 
GeneralRe: Shell_NotifyIcon :: Balloon (HOWTO) Pin
Programm3r13-Apr-07 3:38
Programm3r13-Apr-07 3:38 
Questiongetting two keys from keyboard simultaneously Pin
V_shr13-Apr-07 2:59
V_shr13-Apr-07 2:59 
AnswerRe: getting two keys from keyboard simultaneously Pin
Roger Stoltz13-Apr-07 4:05
Roger Stoltz13-Apr-07 4:05 
AnswerRe: getting two keys from keyboard simultaneously Pin
Dustin Henry13-Apr-07 8:11
Dustin Henry13-Apr-07 8:11 
GeneralRe: getting two keys from keyboard simultaneously Pin
Roger Stoltz14-Apr-07 2:11
Roger Stoltz14-Apr-07 2:11 
QuestionHow to use overloaded operators with template types? Pin
Arris7413-Apr-07 2:08
Arris7413-Apr-07 2:08 
Hello,

I use a template class where I would like to overload the operator [ ].
My intention is that not only the instances of the class will call the operator but also the types of the instances.

I have tried the following code. It works but never the operator [] is called.

Please could tell me if is there a solution to use my own overloaded operator with any type like int, float, long etc..

Thanks for your kind answers.



//ClassTest.h
template <class type>
class ClassTest
{
public:
ClassTest(){};
virtual ~ClassTest(){};
type* Date;
inline type& operator[](UINT i_index){return (at(i_index));};
};


main()
{
// test 1
ClassTest <int> theInt;
theInt.Date = new int[10];
theInt.Date[0] =5; //Does not call type& operator[]


//test2
int array[] = {1996,1997,1998}
ClassTest <int> figure;
figure.Date = array;
int xx = figure.Date[1]; //Does not call type& operator[]

}
AnswerRe: How to use overloaded operators with template types? Pin
Mark Salsbery13-Apr-07 7:46
Mark Salsbery13-Apr-07 7:46 
QuestionHow to run banner on any dialog basesd form in vc++ Pin
Y_Kaushik13-Apr-07 1:28
Y_Kaushik13-Apr-07 1:28 
AnswerRe: How to run banner on any dialog basesd form in vc++ Pin
toxcct13-Apr-07 1:51
toxcct13-Apr-07 1:51 
GeneralRe: How to run banner on any dialog basesd form in vc++ Pin
Y_Kaushik13-Apr-07 2:07
Y_Kaushik13-Apr-07 2:07 
GeneralRe: How to run banner on any dialog basesd form in vc++ Pin
toxcct13-Apr-07 2:09
toxcct13-Apr-07 2:09 
JokeRe: How to run banner on any dialog basesd form in vc++ Pin
Rajesh R Subramanian13-Apr-07 6:38
professionalRajesh R Subramanian13-Apr-07 6:38 
GeneralRe: How to run banner on any dialog basesd form in vc++ Pin
Mila02513-Apr-07 2:44
Mila02513-Apr-07 2:44 
AnswerRe: How to run banner on any dialog basesd form in vc++ Pin
Maximilien13-Apr-07 2:46
Maximilien13-Apr-07 2:46 
GeneralRe: How to run banner on any dialog basesd form in vc++ Pin
toxcct13-Apr-07 3:26
toxcct13-Apr-07 3:26 
QuestionJust linked. Pin
Eytukan13-Apr-07 1:00
Eytukan13-Apr-07 1:00 
AnswerRe: Just linked. Pin
CPallini13-Apr-07 1:21
mveCPallini13-Apr-07 1:21 
GeneralRe: Just linked. Pin
Eytukan13-Apr-07 6:46
Eytukan13-Apr-07 6:46 
AnswerRe: Just linked. Pin
Roger Stoltz13-Apr-07 2:17
Roger Stoltz13-Apr-07 2:17 
GeneralRe: Just linked. Pin
Eytukan13-Apr-07 6:45
Eytukan13-Apr-07 6:45 
QuestionVisual C++ (managed code) Pin
ibhelmer13-Apr-07 0:57
ibhelmer13-Apr-07 0:57 
AnswerRe: Visual C++ (managed code) Pin
Chris Losinger13-Apr-07 3:18
professionalChris Losinger13-Apr-07 3:18 
QuestionHow to paint nonclient area of Window application? Pin
Atul2313-Apr-07 0:15
Atul2313-Apr-07 0:15 

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.