Click here to Skip to main content
15,886,857 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC 8.0 compiler/linker/debuger with VC 6.0 IDE Pin
Sheng Jiang 蒋晟4-Jan-06 7:12
Sheng Jiang 蒋晟4-Jan-06 7:12 
QuestionHow to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 19:23
<color>Aljechin 3-Jan-06 19:23 
AnswerRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 19:32
Prakash Nadar3-Jan-06 19:32 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 19:40
<color>Aljechin 3-Jan-06 19:40 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 19:49
Prakash Nadar3-Jan-06 19:49 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 19:53
<color>Aljechin 3-Jan-06 19:53 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 20:09
<color>Aljechin 3-Jan-06 20:09 
GeneralRe: How to use GetPrivateProfileSection Pin
kakan3-Jan-06 19:54
professionalkakan3-Jan-06 19:54 
There are other ways to do this, but this is one way. Use this func:

<br />
CString getNextItem(char * wholeThing)<br />
{<br />
    CString ret;<br />
    static char * current;<br />
<br />
    if(wholeThing) {<br />
        // Just set at first time<br />
        current = wholeThing;<br />
    }<br />
<br />
    if(*current == '\0') ret = ""; // End<br />
    else {<br />
        ret = current;<br />
        while(*current++);<br />
    }<br />
    return ret;<br />
}<br />


like this:

<br />
CString szValue;<br />
char chpValue[32767];<br />
<br />
GetPrivateProfileSection("SETTINGS",chpValue,sizeof(chpValue),"MySettings.ini");<br />
<br />
szValue = getNextItem(chpValue);<br />
<br />
while(szValue.GetLength()) {<br />
   //Do something with szValue<br />
   szValue = getNextItem(NULL);<br />
};<br />

GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 20:08
<color>Aljechin 3-Jan-06 20:08 
GeneralRe: How to use GetPrivateProfileSection Pin
kakan3-Jan-06 20:22
professionalkakan3-Jan-06 20:22 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 20:26
Prakash Nadar3-Jan-06 20:26 
GeneralRe: How to use GetPrivateProfileSection Pin
kakan3-Jan-06 20:38
professionalkakan3-Jan-06 20:38 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 20:57
<color>Aljechin 3-Jan-06 20:57 
GeneralRe: How to use GetPrivateProfileSection Pin
kakan3-Jan-06 21:03
professionalkakan3-Jan-06 21:03 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 21:33
Prakash Nadar3-Jan-06 21:33 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 21:32
Prakash Nadar3-Jan-06 21:32 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 20:55
<color>Aljechin 3-Jan-06 20:55 
GeneralRe: How to use GetPrivateProfileSection Pin
kakan3-Jan-06 21:13
professionalkakan3-Jan-06 21:13 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 21:31
Prakash Nadar3-Jan-06 21:31 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 22:01
<color>Aljechin 3-Jan-06 22:01 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 22:03
Prakash Nadar3-Jan-06 22:03 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 3-Jan-06 22:11
<color>Aljechin 3-Jan-06 22:11 
GeneralRe: How to use GetPrivateProfileSection Pin
Owner drawn3-Jan-06 23:30
Owner drawn3-Jan-06 23:30 
GeneralRe: How to use GetPrivateProfileSection Pin
Prakash Nadar3-Jan-06 23:41
Prakash Nadar3-Jan-06 23:41 
GeneralRe: How to use GetPrivateProfileSection Pin
<color>Aljechin 4-Jan-06 0:35
<color>Aljechin 4-Jan-06 0:35 

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.