Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

tejaswini_g

@tejaswini_g
About
Posts
6
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Free fails with access violation
    T tejaswini_g

    Reposting as thread has grown #include <> // remove extra angle bracket for compilation #include <> #include <> #include <> void FreeMemory(char** myArray, int row); void FileCountInDir(const TCHAR* dirpath, int * filescount, int* filesize); void FindFilesInDirectory(const TCHAR* dirpath, char** filelist); int _tmain(int argc, TCHAR *argv[]) { int i =0; TCHAR szDirpath[MAX_PATH]; //TCHAR Filelist[100][MAX_PATH]; char ** Filelist; int iFileCountInFolder=0; int iFileSize = 0; _tcscpy(szDirpath,_T("C:\\BMPread_W\\TransitionEffects\\Images")); FileCountInDir(szDirpath,&iFileCountInFolder,&iFileSize); Filelist = (char**)malloc(iFileCountInFolder * sizeof(char *)); if(Filelist == NULL) { fprintf(stderr, "out of memory\n"); return 0; } for(i = 0; i < iFileCountInFolder; i++) { Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1); if(Filelist[i] == NULL) { fprintf(stderr, "out of memory\n"); return 0; } } FindFilesInDirectory(szDirpath, Filelist); for(i =0;i 0)|| ((*filesize) < _tcslen(ffd.cFileName))) { (*filesize) = _tcslen(ffd.cFileName); } } } while (FindNextFile(hFind, &ffd) != 0); FindClose(hFind); } void FreeMemory(char** myArray, int row) { int i; if(myArray != NULL) { for (i = 0; i < row; i++){

    free (myArray[i]);

    } }

    C / C++ / MFC performance

  • Free fails with Access violation reading location
    T tejaswini_g

    iFileCountInFolder is always fixed, since the files in a folder are fixed , means no files are added at run time. I did not understand why the Free statement is failing.

    C / C++ / MFC help performance question

  • Free fails with Access violation reading location
    T tejaswini_g

    I am posting compiled code. As stated above Freelist[i] fails. Highlighted the statement causing error. #include <> // remove extra angle bracket for compilation #include <> #include <> #include <> void FreeMemory(char** myArray, int row); void FileCountInDir(const TCHAR* dirpath, int * filescount, int* filesize); void FindFilesInDirectory(const TCHAR* dirpath, char** filelist); int _tmain(int argc, TCHAR *argv[]) { int i =0; TCHAR szDirpath[MAX_PATH]; //TCHAR Filelist[100][MAX_PATH]; char ** Filelist; int iFileCountInFolder=0; int iFileSize = 0; _tcscpy(szDirpath,_T("C:\\BMPread_W\\TransitionEffects\\Images")); FileCountInDir(szDirpath,&iFileCountInFolder,&iFileSize); Filelist = (char**)malloc(iFileCountInFolder * sizeof(char *)); if(Filelist == NULL) { fprintf(stderr, "out of memory\n"); return 0; } for(i = 0; i < iFileCountInFolder; i++) { Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1); if(Filelist[i] == NULL) { fprintf(stderr, "out of memory\n"); return 0; } } FindFilesInDirectory(szDirpath, Filelist); for(i =0;i

    C / C++ / MFC help performance question

  • Free fails with Access violation reading location
    T tejaswini_g

    re posted.

    C / C++ / MFC help performance question

  • Free fails with Access violation reading location
    T tejaswini_g

    Can anyone help what is wrong in the following code snippet.

    free (Filelist[i]);

    fails with access violation error. Thanks in advance. int _tmain(int argc, TCHAR *argv[]) { int i =0; char ** Filelist; int iFileCountInFolder=0; int iFileSize = 0; _tcscpy(szDirpath,_T("C:\\BMPread_W\\TransitionEffects\\Images")); FileCountInDir(szDirpath,&iFileCountInFolder,&iFileSize); Filelist = (char**)malloc(iFileCountInFolder * sizeof(char *)); if(Filelist == NULL) { fprintf(stderr, "out of memory\n"); return; } for(i = 0; i < iFileCountInFolder; i++) { Filelist[i] = (char*)malloc((iFileSize * sizeof(char))+1); if(Filelist[i] == NULL) { fprintf(stderr, "out of memory\n"); return; } } FindFilesInDirectory(szDirpath, Filelist, &iFileCountInFolder); if (Filelist != NULL) { for ( i = 0; i < iFileCountInFolder ; i++)

    //following line failing with access voilation
    free (Filelist[i]);

    free (Filelist); } return 0; }

    C / C++ / MFC help performance question

  • How can I create modless propertypage using MFC
    T tejaswini_g

    In my project I need to create a modless property sheet with two property pages using MFC.Please help me.

    C / C++ / MFC c++ help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups