Click here to Skip to main content
15,914,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Apply header programmatically Pin
Michael Dunn13-Apr-07 8:43
sitebuilderMichael Dunn13-Apr-07 8:43 
QuestionClosing a dialog box Pin
llp00na13-Apr-07 4:20
llp00na13-Apr-07 4:20 
AnswerRe: Closing a dialog box Pin
bob1697213-Apr-07 5:02
bob1697213-Apr-07 5:02 
GeneralRe: Closing a dialog box Pin
llp00na13-Apr-07 5:14
llp00na13-Apr-07 5:14 
GeneralRe: Closing a dialog box Pin
bob1697213-Apr-07 5:44
bob1697213-Apr-07 5:44 
GeneralRe: Closing a dialog box Pin
llp00na13-Apr-07 6:21
llp00na13-Apr-07 6:21 
GeneralRe: Closing a dialog box Pin
bob1697213-Apr-07 7:25
bob1697213-Apr-07 7:25 
GeneralRe: Closing a dialog box Pin
llp00na16-Apr-07 1:58
llp00na16-Apr-07 1:58 
QuestionShutdown Pin
prathuraj13-Apr-07 4:13
prathuraj13-Apr-07 4:13 
AnswerRe: Shutdown Pin
Roger Stoltz13-Apr-07 4:24
Roger Stoltz13-Apr-07 4:24 
GeneralRe: Shutdown Pin
prathuraj13-Apr-07 4:26
prathuraj13-Apr-07 4:26 
GeneralRe: Shutdown Pin
Roger Stoltz13-Apr-07 4:29
Roger Stoltz13-Apr-07 4:29 
GeneralRe: Shutdown Pin
prathuraj13-Apr-07 4:31
prathuraj13-Apr-07 4:31 
QuestionOverwriting a file in VC++ Pin
Harish_kj13-Apr-07 3:39
Harish_kj13-Apr-07 3:39 
AnswerRe: Overwriting a file in VC++ Pin
Maximilien13-Apr-07 3:58
Maximilien13-Apr-07 3:58 
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 

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.