Click here to Skip to main content
15,919,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: random NUmbers Pin
ib04212911-Jul-02 10:07
ib04212911-Jul-02 10:07 
GeneralRe: random NUmbers Pin
Joaquín M López Muñoz11-Jul-02 11:09
Joaquín M López Muñoz11-Jul-02 11:09 
QuestionHow to show File Preview in the Windows Explorer. Pin
Ganesh Agrawal11-Jul-02 9:18
Ganesh Agrawal11-Jul-02 9:18 
AnswerRe: How to show File Preview in the Windows Explorer. Pin
KaЯl12-Jul-02 5:01
KaЯl12-Jul-02 5:01 
GeneralRe: How to show File Preview in the Windows Explorer. Pin
Ganesh Agrawal12-Jul-02 6:25
Ganesh Agrawal12-Jul-02 6:25 
GeneralWrong return type from CObList (newb question) Pin
EBerlin11-Jul-02 8:25
EBerlin11-Jul-02 8:25 
GeneralProblem Fixed Pin
EBerlin11-Jul-02 8:30
EBerlin11-Jul-02 8:30 
GeneralRe: Wrong return type from CObList (newb question) Pin
jbarton11-Jul-02 9:12
jbarton11-Jul-02 9:12 
Instead of using CObList directly, you should use CTypedPtrList to make the list typesafe. You can put any pointer which is derived from CObject into a CObList. You also need to cast the value when you take it out of a CObList (which again could lead to errors if the actual pointer is not the type that you are casting it to).

To use CTypedPtrList to contain pointers to State objects, you can declare it as follows:

CTypedPtrList<CObList,State *> stateList;

This list works the same as CObList, except that you can only put State * objects into the list, and any objects you get from the list are State * objects.

So, this works:

m_Bookmark = stateList.AddTail( new State(Name,Loc,pop,area) );

And, this works:

State *pObject = stateList.GetAt( m_Bookmark ); // note: no cast

Best regards,
John

GeneralRe: Wrong return type from CObList (newb question) Pin
EBerlin11-Jul-02 10:55
EBerlin11-Jul-02 10:55 
GeneralRe: Wrong return type from CObList (newb question) Pin
jbarton15-Jul-02 2:08
jbarton15-Jul-02 2:08 
QuestionOLE?? Pin
Kuniva11-Jul-02 7:52
Kuniva11-Jul-02 7:52 
AnswerRe: OLE?? Pin
Anonymous11-Jul-02 8:04
Anonymous11-Jul-02 8:04 
GeneralGetting DevStudio dependencies correct Pin
Jonathan Gilligan11-Jul-02 7:47
Jonathan Gilligan11-Jul-02 7:47 
GeneralRe: Getting DevStudio dependencies correct Pin
J Patel11-Jul-02 11:48
J Patel11-Jul-02 11:48 
GeneralACtiveX Guru's... Pin
Anonymous11-Jul-02 7:29
Anonymous11-Jul-02 7:29 
GeneralRe: ACtiveX Guru's... Pin
Bill Wilson11-Jul-02 11:56
Bill Wilson11-Jul-02 11:56 
GeneralArray of structure Pin
Richard Jones11-Jul-02 7:29
Richard Jones11-Jul-02 7:29 
GeneralRe: Array of structure Pin
Nish Nishant11-Jul-02 7:38
sitebuilderNish Nishant11-Jul-02 7:38 
GeneralRe: Array of structure Pin
Christian Graus11-Jul-02 12:06
protectorChristian Graus11-Jul-02 12:06 
QuestionCDialog close, if i press Enter - Why??? Pin
Koep11-Jul-02 7:13
Koep11-Jul-02 7:13 
AnswerRe: CDialog close, if i press Enter - Why??? Pin
Nish Nishant11-Jul-02 7:28
sitebuilderNish Nishant11-Jul-02 7:28 
GeneralRe: CDialog close, if i press Enter - Why??? Pin
Koep11-Jul-02 7:31
Koep11-Jul-02 7:31 
GeneralRe: CDialog close, if i press Enter - Why??? Pin
Nish Nishant11-Jul-02 7:34
sitebuilderNish Nishant11-Jul-02 7:34 
GeneralRe: CDialog close, if i press Enter - Why??? Pin
Koep11-Jul-02 21:38
Koep11-Jul-02 21:38 
AnswerRe: CDialog close, if i press Enter - Why??? Pin
Michael Dunn11-Jul-02 14:19
sitebuilderMichael Dunn11-Jul-02 14:19 

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.