Click here to Skip to main content
15,917,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionChanging Active View Pin
_Tom_2-Jul-06 23:27
_Tom_2-Jul-06 23:27 
AnswerRe: Changing Active View Pin
Viorel.2-Jul-06 23:38
Viorel.2-Jul-06 23:38 
GeneralRe: Changing Active View Pin
_Tom_3-Jul-06 0:59
_Tom_3-Jul-06 0:59 
GeneralRe: Changing Active View Pin
Viorel.3-Jul-06 1:26
Viorel.3-Jul-06 1:26 
AnswerRe: Changing Active View [modified] Pin
Cliff Hatch3-Jul-06 11:36
Cliff Hatch3-Jul-06 11:36 
QuestionUrgent :- How to read the unicode file with C/C++ Pin
Rocky Marrone2-Jul-06 23:26
Rocky Marrone2-Jul-06 23:26 
AnswerRe: Urgent :- How to read the unicode file with C/C++ Pin
Justin Tay3-Jul-06 2:08
Justin Tay3-Jul-06 2:08 
GeneralRe: Urgent :- How to read the unicode file with C/C++ Pin
Rocky Marrone3-Jul-06 2:51
Rocky Marrone3-Jul-06 2:51 
GeneralRe: Urgent :- How to read the unicode file with C/C++ Pin
Justin Tay3-Jul-06 2:56
Justin Tay3-Jul-06 2:56 
Questionhow to enumerate domain name list? Pin
host282-Jul-06 23:23
host282-Jul-06 23:23 
QuestionC++ Pin
Nirmal Khatri2-Jul-06 23:02
Nirmal Khatri2-Jul-06 23:02 
AnswerRe: C++ Pin
Cedric Moonen2-Jul-06 23:05
Cedric Moonen2-Jul-06 23:05 
QuestionAdding a toolbar in Win32 Application Pin
Cyber Friend2-Jul-06 22:56
Cyber Friend2-Jul-06 22:56 
Questionproblem on resize window???? Pin
mimimimilaw2-Jul-06 22:55
mimimimilaw2-Jul-06 22:55 
QuestionRe: problem on resize window???? Pin
see me2-Jul-06 23:19
see me2-Jul-06 23:19 
AnswerRe: problem on resize window???? Pin
mimimimilaw2-Jul-06 23:29
mimimimilaw2-Jul-06 23:29 
GeneralRe: problem on resize window???? Pin
see me2-Jul-06 23:35
see me2-Jul-06 23:35 
QuestionHow to validate data in property sheet. Pin
jadhav1232-Jul-06 22:53
jadhav1232-Jul-06 22:53 
AnswerRe: How to validate data in property sheet. Pin
Viorel.2-Jul-06 23:15
Viorel.2-Jul-06 23:15 
GeneralRe: How to validate data in property sheet. Pin
jadhav1236-Jul-06 23:25
jadhav1236-Jul-06 23:25 
AnswerRe: How to validate data in property sheet. Pin
Rudolf Jan3-Jul-06 0:55
Rudolf Jan3-Jul-06 0:55 
QuestionVector Problem [modified] Pin
CornToeGoblin2-Jul-06 22:51
CornToeGoblin2-Jul-06 22:51 
What i am trying to do is make a console program that gets playlist info from winamp and stores 2 things, the track number and the corresponding track name and stores it into a vector that is a struct with and int and a char defined like this:

struct sIPlaylist
{
char *Name;
int Position;
};
vector <siplaylist> dPlaylist;

The problem that i am having is that after i do a loop and go through the entire playlist and store both values for each song when i try to recall it like this:

Console::WriteLine(dPlaylist.at(a).Name);

no matter what number i put at a the text is always the last song name in the playlist escentially all of the Name part of the vector are the same text. this is how the loop is defined:

void CWinamp::gEntirePlaylist()
{
sIPlaylist tmp; // i think this might be where my problem is but im reseting the values at the beginning of each loop
for(int i=0; i < wInfo.pTotal ; i++) // run the loop until the end of the playlist
{
tmp.Name="";
tmp.Position=i+1;
tmp.Name=gTrackName(i); // gTrackName returns a char * with the song name of playlist track number i
dPlaylist.push_back(tmp); // move the lastest info to the bottom of the vector
}
Console::WriteLine(dPlaylist.size());
Console::Write(dPlaylist.at(222).Position); // this works perfectly
Console::Write(". ");
Console::WriteLine(dPlaylist.at(222).Name);
}

This is the console output:

222. Benny Bennassi .... Whos your daddy

that song isnt actually number 222 but actually number 3111 which is the last song in the playlist.

Im not sure what im missing but i obviously have some part of my code wrong and i would really appreciate any help.

- Corntoe

-- modified at 4:53 Monday 3rd July, 2006
QuestionRe: Vector Problem Pin
Sarath C2-Jul-06 22:58
Sarath C2-Jul-06 22:58 
AnswerRe: Vector Problem Pin
Cedric Moonen2-Jul-06 22:59
Cedric Moonen2-Jul-06 22:59 
AnswerRe: Vector Problem Pin
Viorel.2-Jul-06 23:06
Viorel.2-Jul-06 23:06 

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.