I'm trying to send a list of songnames to a client i built. Everything compiles fine, it even sends the first filename right. When the server begins to send the second filename it sends every filename as one. E.g:
First: Like the way.mp3
Second: Pump it up.mp3Billionaire.mp3...... it just continues like this.

I also print every filename with "cout", and there's everything fine.

CFileFind finder;
    CString myDirectory = "E:\\Users\\****\\Music\\Musiklk\\";
    BOOL finding = finder.FindFile (myDirectory + CString ("\\*.mp3"));
    while (finding)
        finding = finder.FindNextFile();
        CString fname = finder.GetFileName();
        char songname[200] = "";
        strncpy((char *) songname, (LPCTSTR) fname, sizeof(songname));
        cout << songname << endl;
    finder.Close ();

BTW: I'm still learning C++....


cout << songname << endl;

works as intended and prints the song names on each individual line, then the send function is missing the endl. Is send in a library or a function you created? I'm not familiar with it if it's from a library.

The send() function is there to send the string to the socket and the socket sends it to the client. The weird thing is that it seems that the loop puts everything in the string at the same time... 'Cause when i use 2 different strings and send both of them, everything works fine..