Solved

Is there any restriction on characters used in CMapWordToPtr key value?

Posted on 2007-11-21
7
228 Views
Last Modified: 2013-11-20
What are the unacceptable characters in the key?
Thanks
Eugene
0
Comment
Question by:shiffin
  • 3
  • 2
  • 2
7 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20330218
characters?
Word means a 16-bit integer, not a string at all
Maybe you need CMapStringToPtr, unique forbidden character is null (ascii 0)
0
 

Author Comment

by:shiffin
ID: 20330250
I am sorry. It was CMapStringToPtr
Thanks
Eugene
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 20330275
Then you have the answer. Unique restricted character: ASCII 0
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:jkr
ID: 20330420
The same restrictions as for CStrings apply. What chracter/string is giving you trouble?
0
 

Author Comment

by:shiffin
ID: 20332427
I think I am doing a different mistake
Inside loop, I remove some keys. I think this is the problem. Is it?
Eugene
    pCurVal= myMap.PGetFirstAssoc( );

    while (pCurVal != NULL)

    {

           pCurVal= myMap.PGetNextAssoc(pCurVal);

           if(OnSomeCondition){

            delete myMap.pointer

             myMap.RemoveKey("xxx")

           }

    }

    if(myMap.IsEmpty())myMap.RemoveAll()

Open in new window

0
 
LVL 86

Expert Comment

by:jkr
ID: 20332452
So far, that looks ok. What error are you getting and what is the original code?
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 250 total points
ID: 20332462
You have not exposed your problem. Error message? Undesired result?
In you code I see something strange:

while (pCurVal != NULL)
    {
           if(OnSomeCondition){
            delete myMap.pointer
             myMap.RemoveKey("xxx")
           }
           pCurVal= myMap.PGetNextAssoc(pCurVal);  // notice the position of this line
    }
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now