Click here to Skip to main content
15,921,463 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: How to use CListCtrl with CImageList? Pin
Hamid_RT31-May-07 18:27
Hamid_RT31-May-07 18:27 
AnswerRe: How to use CListCtrl with CImageList? Pin
whiteclouds4-Jun-07 15:41
whiteclouds4-Jun-07 15:41 
QuestionC++ reference continued Pin
C_Zealot31-May-07 13:02
C_Zealot31-May-07 13:02 
AnswerRe: C++ reference continued Pin
Christian Graus31-May-07 13:29
protectorChristian Graus31-May-07 13:29 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 14:26
Stephen Hewitt31-May-07 14:26 
GeneralRe: C++ reference continued Pin
Christian Graus31-May-07 18:28
protectorChristian Graus31-May-07 18:28 
GeneralRe: C++ reference continued Pin
Stephen Hewitt31-May-07 18:57
Stephen Hewitt31-May-07 18:57 
AnswerRe: C++ reference continued Pin
Mark Salsbery31-May-07 14:08
Mark Salsbery31-May-07 14:08 
If you must (against Christian's advice) nest the typedef you need to use a scope resolution
operator to reference the nested class/type from outside the class:
WordTable::OccurrenceList& WordTable::getOccurrences(string word)
{
    WordTable::OccurrenceList list; // Note the "WordTable::" is optional here
                                    //   since you're already in the WordTable class scope
 
    return list; //<code><--- Bug - returning a reference to a temporary variable!</code>
}

A template defines a class. If you nest the class in another class then you need to resolve the
scope anywhere outside of the class, as shown above.

Plus there's a bug, noted above Smile | :)

Mark






"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: C++ reference continued Pin
C_Zealot31-May-07 14:29
C_Zealot31-May-07 14:29 
AnswerRe: C++ reference continued Pin
Jeffrey Walton31-May-07 20:39
Jeffrey Walton31-May-07 20:39 
GeneralCTreeCtrl - GetSelectedItem [modified] Pin
Vaclav_31-May-07 12:26
Vaclav_31-May-07 12:26 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 15:24
Naveen31-May-07 15:24 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 15:55
Vaclav_31-May-07 15:55 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Naveen31-May-07 16:01
Naveen31-May-07 16:01 
GeneralRe: CTreeCtrl - GetSelectedItem Pin
Vaclav_31-May-07 16:28
Vaclav_31-May-07 16:28 
QuestionErrors? C++, play with reference Pin
C_Zealot31-May-07 11:55
C_Zealot31-May-07 11:55 
AnswerRe: Errors? C++, play with reference Pin
Mark Salsbery31-May-07 12:13
Mark Salsbery31-May-07 12:13 
GeneralRe: Errors? C++, play with reference Pin
C_Zealot31-May-07 12:16
C_Zealot31-May-07 12:16 
QuestionVC++ 6 -warpper Pin
Tal S.31-May-07 9:54
Tal S.31-May-07 9:54 
AnswerRe: VC++ 6 -warpper Pin
Matthew Faithfull31-May-07 10:06
Matthew Faithfull31-May-07 10:06 
AnswerRe: VC++ 6 -warpper Pin
Chris Losinger31-May-07 10:43
professionalChris Losinger31-May-07 10:43 
AnswerRe: VC++ 6 -warpper Pin
Hamid_RT31-May-07 18:27
Hamid_RT31-May-07 18:27 
Questionconverting from const char [] to 'LPWSTR' Pin
maizhiming31-May-07 9:28
maizhiming31-May-07 9:28 
AnswerRe: converting from const char [] to 'LPWSTR' Pin
Matthew Faithfull31-May-07 9:43
Matthew Faithfull31-May-07 9:43 
AnswerRe: converting from const char [] to 'LPWSTR' Pin
Xing Chen31-May-07 15:18
Xing Chen31-May-07 15:18 

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.