CompuServe Thread

Using CMapStringToObj?

2 messages in this thread
#30233From: Mark H. JamesJul 8, 1994 2:36 AM
I think you want to use a CObject pointer in the function, and then after you get it, cast it to a pointer to your own class that you are mapping before using it, something like: CObject* pObj; GetNextAssoc ( …, … , pObj); CMyClass* pMyClass = (CMyClass*) pObj; There may be an easier way to do this that I don't know about, though. –mark j.
#30644From: SuperStudioJul 12, 1994 4:09 AM
Dear Mark, thanks for your reply. In fact, I was already using a manual cast as the solution, but it seemed a messy thing to me, and it doesn't answer the basic question, why doesn't the Microsoft example work? (of course, it works if you do the manual cast, bu that isn't in the example?) any ideas? Thanks.