Click here to Skip to main content
14,926,387 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Newbee Exception handling Guidance Pin
jeron126-Jul-16 4:22
Memberjeron126-Jul-16 4:22 
GeneralRe: Newbee Exception handling Guidance Pin
Daniel Pfeffer26-Jul-16 4:33
professionalDaniel Pfeffer26-Jul-16 4:33 
GeneralRe: Newbee Exception handling Guidance Pin
jeron126-Jul-16 5:30
Memberjeron126-Jul-16 5:30 
QuestionGet Window Handle to Modless Dialog Box After Create Pin
ForNow24-Jul-16 12:57
MemberForNow24-Jul-16 12:57 
AnswerRe: Get Window Handle to Modless Dialog Box After Create Pin
CPallini24-Jul-16 20:36
mveCPallini24-Jul-16 20:36 
GeneralRe: Get Window Handle to Modless Dialog Box After Create Pin
ForNow25-Jul-16 4:13
MemberForNow25-Jul-16 4:13 
AnswerRe: Get Window Handle to Modless Dialog Box After Create Pin
Victor Nijegorodov24-Jul-16 21:47
MemberVictor Nijegorodov24-Jul-16 21:47 
QuestionGenerate Unique Ids Pin
Member 1053345022-Jul-16 8:33
MemberMember 1053345022-Jul-16 8:33 
Generate Unique Ids
 
FormStrings(unsigned int id, string bigText)
{
//create small strings from bigText say string1, string2...string k
for(int x = 0; x< k; ++x)
unsigned int id uid = generateUniqueId(..);
ForwardString(uid, stringx)
}
 
 
FormStrings() method receives id which starts from 1 and increments ahead as FormStrings() method is called.
 
FormStrings() method further split the bigText received into smaller strings and passes to other methods. 
 
Requirement is to generate a unique 32 bit id for the new strings created. I should also take care of how many uids are getting created from id, so that if later anyone calls delete id, all the sub-uids string should get deleted.
 
For example:
 
FormStrings(1, "Hi, I want to learn cpp.")
string1 = Hi,
String2 = I want to
String3 = learn cpp.
Here id 1 has 3 substrings. I need to create 3 uids.
 
Next time when FormStrings() method is called, it will come with an id 2, then 3 and so on.
 
I thought of creating id using 32 bits as
16 bits for id - 65535 ids
8 bits for storing number of strings formed.
 
but when I ran the actual program, I found out that 65535 is a small number to store id, it could be a very big number(20 bits will also not work), even number of strings formed  from bigText is not fixed. I am open to create new variables, structs etc
 
Any suggestions are welcome.

AnswerRe: Generate Unique Ids Pin
Richard MacCutchan22-Jul-16 21:11
mveRichard MacCutchan22-Jul-16 21:11 
AnswerRe: Generate Unique Ids Pin
leon de boer23-Jul-16 4:42
Memberleon de boer23-Jul-16 4:42 
Questionlearning steganography Pin
jhonganteng22-Jul-16 4:54
Memberjhonganteng22-Jul-16 4:54 
AnswerRe: learning steganography Pin
Richard MacCutchan22-Jul-16 4:58
mveRichard MacCutchan22-Jul-16 4:58 
QuestionCString Concatenation question Pin
ForNow21-Jul-16 6:56
MemberForNow21-Jul-16 6:56 
AnswerRe: CString Concatenation question Pin
Jochen Arndt21-Jul-16 7:48
professionalJochen Arndt21-Jul-16 7:48 
GeneralRe: CString Concatenation question Pin
ForNow21-Jul-16 11:59
MemberForNow21-Jul-16 11:59 
GeneralRe: CString Concatenation question Pin
Saravanan Sundaresan24-Sep-16 20:07
professionalSaravanan Sundaresan24-Sep-16 20:07 
Question__interface keyword not practicable when derived class exports to dll? Pin
FriendOfAsherah20-Jul-16 23:17
MemberFriendOfAsherah20-Jul-16 23:17 
Questionhow to make steganography in C++ Pin
jhonganteng20-Jul-16 21:35
Memberjhonganteng20-Jul-16 21:35 
AnswerRe: how to make steganography in C++ Pin
CPallini20-Jul-16 22:14
mveCPallini20-Jul-16 22:14 
GeneralRe: Sorry? What is the operator 'shift up' (and 'shift down'?)? Pin
jhonganteng21-Jul-16 4:50
Memberjhonganteng21-Jul-16 4:50 
AnswerRe: how to make steganography in C++ Pin
leon de boer21-Jul-16 1:57
Memberleon de boer21-Jul-16 1:57 
Questionerror 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 20:23
MemberFriendOfAsherah20-Jul-16 20:23 
AnswerRe: error 2039 {dtor} is not element of ImyInterface - when does this happen? Pin
FriendOfAsherah20-Jul-16 22:54
MemberFriendOfAsherah20-Jul-16 22:54 
Questionprotected access specifier Pin
kinderu19-Jul-16 4:52
Memberkinderu19-Jul-16 4:52 
AnswerRe: protected access specifier Pin
Richard MacCutchan19-Jul-16 5:29
mveRichard MacCutchan19-Jul-16 5:29 

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.