Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC CfileDialog Pin
Zac Howland22-Jun-06 3:35
Zac Howland22-Jun-06 3:35 
QuestionRe: MFC CfileDialog Pin
Hamid_RT21-Jun-06 19:22
Hamid_RT21-Jun-06 19:22 
QuestionSetting language used for menus/dialogs (UI language) Pin
fourierman21-Jun-06 6:33
fourierman21-Jun-06 6:33 
QuestionSDI MFC APP -- Change title Pin
tingu21-Jun-06 6:00
tingu21-Jun-06 6:00 
AnswerRe: SDI MFC APP -- Change title Pin
led mike21-Jun-06 6:34
led mike21-Jun-06 6:34 
AnswerRe: SDI MFC APP -- Change title Pin
James R. Twine21-Jun-06 6:38
James R. Twine21-Jun-06 6:38 
QuestionHow to select tabs from the menu bar? Pin
Ashutosh Bagaria21-Jun-06 5:53
Ashutosh Bagaria21-Jun-06 5:53 
QuestionCTypedPtrArray and CTypedPtrMap [modified] Pin
bob1697221-Jun-06 5:34
bob1697221-Jun-06 5:34 
/* I'm managing numerous controls as CMyObject for multiple pages in multiple documents (Not CDocument). The PageArrays are allocated on the heap and then placed in the DocArray using "Add". Then the CMyObjects are allocated on the heap and placed in the MyObjectArray using the same. Each document gets some pages, and each page has some controls. I'm using the following abomination to mimic a three dimensional array using the MFC type safe collections...
*/

// Appears to work
typedef CTypedPtrArray<CObArray,CMyObject*> MyObjectArray;
typedef CTypedPtrArray<CObArray,MyObjectArray*> PageArray;
typedef CTypedPtrArray<CObArray,PageArray*> DocArray;
DocArray m_DocArray;

/*
Now, I am trying to provide an object map for each page in each document for quick access to those same CMyObject controls. I am attempting the same except with a map in the third dimension. So it is array, array, then map.
*/

// Does not work. Asserts when trying to add a MyObjectMap
typedef CTypedPtrMap<CMapStringToOb, CString, CMyObject*> MyObjectMap;
typedef CTypedPtrArray<CObArray,MyObjectMap*> PageNameArray;
typedef CTypedPtrArray<CObArray,PageNameArray*> DocNameArray;
DocNameArray m_DocMap;

/*
Attempts to "new" a PageNameArray on the heap and using "add" to put it into the m_DocMap "appears" to work but it asserts when I attempt to index that pointer to add a MyObjectMap allocated on the heap into the PageNameArray...
*/

m_DocMap[nIndex]->Add(pMyObjectMap); // ASSERTS. nIndex is what I'd expect during Trace

/* Also, when I "dot" m_DocMap intellisense does not give me the choices like GetSize().
It gives me
"add()",
"append()",
"copy()",
"ElementAt()",
"GetAt()",
"InsertAt()",
"Operator[]",
"SetAt()",
"SetAtGrow()"
*/

// Does anyone see what I'm doing wrong in the declaration of m_DocMap?

-- modified at 12:21 Wednesday 21st June, 2006

I am coding this using VC++ 2003. I noticed that my intellisense gives me the expected options when I drop the declaration into a VC++ 6.0 project and "dot" the member variable. Not sure if that helps.
AnswerRe: CTypedPtrArray and CTypedPtrMap Pin
bob1697221-Jun-06 7:17
bob1697221-Jun-06 7:17 
QuestionList of network interface Pin
fabiotriolo21-Jun-06 5:30
fabiotriolo21-Jun-06 5:30 
AnswerRe: List of network interface Pin
lordxx21-Jun-06 5:37
lordxx21-Jun-06 5:37 
AnswerRe: List of network interface Pin
David Crow21-Jun-06 5:46
David Crow21-Jun-06 5:46 
Questionerror LNK2001 & error LNK1120 with GUIDs Pin
kitty521-Jun-06 4:56
kitty521-Jun-06 4:56 
AnswerRe: error LNK2001 &amp; error LNK1120 with GUIDs [modified] Pin
Viorel.21-Jun-06 5:06
Viorel.21-Jun-06 5:06 
QuestionPorting code to PPC WinCE Pin
Mike Doner21-Jun-06 4:50
Mike Doner21-Jun-06 4:50 
QuestionDebug vs. Release Build Pin
Bob X21-Jun-06 4:34
Bob X21-Jun-06 4:34 
AnswerRe: Debug vs. Release Build Pin
kitty521-Jun-06 4:43
kitty521-Jun-06 4:43 
GeneralRe: Debug vs. Release Build Pin
Bob X21-Jun-06 5:01
Bob X21-Jun-06 5:01 
AnswerRe: Debug vs. Release Build Pin
Viorel.21-Jun-06 4:59
Viorel.21-Jun-06 4:59 
GeneralRe: Debug vs. Release Build [modified] Pin
Bob X21-Jun-06 5:05
Bob X21-Jun-06 5:05 
GeneralRe: Debug vs. Release Build Pin
John M. Drescher21-Jun-06 5:07
John M. Drescher21-Jun-06 5:07 
GeneralRe: Debug vs. Release Build Pin
Viorel.21-Jun-06 5:10
Viorel.21-Jun-06 5:10 
GeneralRe: Debug vs. Release Build Pin
Bob X21-Jun-06 5:13
Bob X21-Jun-06 5:13 
GeneralRe: Debug vs. Release Build Pin
Maximilien21-Jun-06 5:19
Maximilien21-Jun-06 5:19 
GeneralRe: Debug vs. Release Build Pin
Viorel.21-Jun-06 5:22
Viorel.21-Jun-06 5:22 

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.