Click here to Skip to main content
15,914,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dllimport vs dllexport Pin
Alexandru Savescu16-Jul-02 4:17
Alexandru Savescu16-Jul-02 4:17 
GeneralRe: dllimport vs dllexport Pin
Mike Zinni16-Jul-02 4:45
Mike Zinni16-Jul-02 4:45 
GeneralRe: dllimport vs dllexport Pin
Mike Zinni16-Jul-02 5:02
Mike Zinni16-Jul-02 5:02 
GeneralRe: dllimport vs dllexport Pin
Mike Nordell16-Jul-02 5:24
Mike Nordell16-Jul-02 5:24 
GeneralRe: dllimport vs dllexport Pin
Daniel Lohmann17-Jul-02 14:23
Daniel Lohmann17-Jul-02 14:23 
QuestionSTL iterators? Pin
Fredrik Skog16-Jul-02 4:00
Fredrik Skog16-Jul-02 4:00 
Why do I get an access violation when I try to get the value of the iterator "it" in this piece of code? When I look at the iterators they have no valid pointers to the strings.
typedef vector<CString*> TFileList;
typedef TFileList::iterator TFileListIt;

CStringList strlistFiles;
fsDlg.SelectFile(&strlistFiles);
int nFiles = strlistFiles.GetCount();

if (nFiles > 0)
{
    int nIndex;
    TFileList FileList(nFiles);

    CString strFileName, strNewFileName;
    POSITION pos;

    // Populate the list with the pointers to the file names.
    for (nIndex = 0; nIndex < nFiles; nIndex++)
    {
        pos = strlistFiles.FindIndex(nIndex);
        FileList.push_back(&strlistFiles.GetAt(pos));
    }

    TFileListIt start, end, it;
    start = FileList.begin();
    end = FileList.end();
    for (it = start; it != end; it++)
    {
        TRACE("> %s\n", **it);   // <-- Access violation!
    }
}


Cheers,
Fredrik

<right>Sonork ID: 100.11430:PhatBoy

"Felix qui potuit rerum cognoscere causas."
AnswerRe: STL iterators? Pin
Alexandru Savescu16-Jul-02 4:08
Alexandru Savescu16-Jul-02 4:08 
GeneralRe: STL iterators? Pin
Fredrik Skog16-Jul-02 4:12
Fredrik Skog16-Jul-02 4:12 
GeneralRe: STL iterators? Pin
Alexandru Savescu16-Jul-02 4:22
Alexandru Savescu16-Jul-02 4:22 
GeneralRe: STL iterators? Pin
Fredrik Skog16-Jul-02 4:30
Fredrik Skog16-Jul-02 4:30 
GeneralRe: STL iterators? Pin
Alexandru Savescu16-Jul-02 4:35
Alexandru Savescu16-Jul-02 4:35 
GeneralRe: STL iterators? Pin
Fredrik Skog16-Jul-02 4:42
Fredrik Skog16-Jul-02 4:42 
AnswerNow I got it!!! Pin
Alexandru Savescu16-Jul-02 4:43
Alexandru Savescu16-Jul-02 4:43 
GeneralRe: Now I got it!!! Pin
Fredrik Skog16-Jul-02 4:48
Fredrik Skog16-Jul-02 4:48 
GeneralCFile access Pin
Raphael Kindt16-Jul-02 3:28
Raphael Kindt16-Jul-02 3:28 
GeneralRe: CFile access Pin
Fredrik Skog16-Jul-02 3:47
Fredrik Skog16-Jul-02 3:47 
GeneralRe: CFile access Pin
Raphael Kindt16-Jul-02 4:23
Raphael Kindt16-Jul-02 4:23 
Generalwant to anchor MDI child CFormView to Frame Pin
ns16-Jul-02 3:24
ns16-Jul-02 3:24 
GeneralI think cs.style &= ~WS_THICKFRAME; Pin
ns16-Jul-02 3:30
ns16-Jul-02 3:30 
GeneralDelay by pull mode Pin
Member 106269816-Jul-02 2:59
Member 106269816-Jul-02 2:59 
GeneralActiveMovie4 -- PLEASE HELP Pin
Anonymous16-Jul-02 2:50
Anonymous16-Jul-02 2:50 
GeneralRe: ActiveMovie4 -- PLEASE HELP Pin
Rage16-Jul-02 3:09
professionalRage16-Jul-02 3:09 
GeneralRe: ActiveMovie4 -- PLEASE HELP Pin
Anonymous16-Jul-02 3:19
Anonymous16-Jul-02 3:19 

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.