Click here to Skip to main content

C / C++ / MFC

 
AnswerRe: Free fails with access violation PinprofessionalRichard Andrew x6425-Mar-14 6:59 
AnswerRe: Free fails with access violation Pinmemberleon de boer25-Mar-14 18:36 
AnswerRe: Free fails with access violation Pinmemberpwasser25-Mar-14 21:13 
GeneralDirectShow GraphEdit missing property page options tab. PARTIALLY SOLVED - CLOSED [modified] PinmemberVaclav_Sal24-Mar-14 16:42 
GeneralRe: DirectShow GraphEdit missing property page options tab. PinprofessionalRage25-Mar-14 3:19 
Generalx it.Re: DirectShow GraphEdit missing property page options tab.IN PROGRESS [modified] PinmemberVaclav_Sal25-Mar-14 8:29 
QuestionFree fails with Access violation reading location [modified] Pinmembertejaswini_g24-Mar-14 14:31 
AnswerRe: Free fails with Access violation reading location PinprofessionalRichard Andrew x6424-Mar-14 14:42 
GeneralRe: Free fails with Access violation reading location Pinmembertejaswini_g24-Mar-14 16:01 
AnswerRe: Free fails with Access violation reading location Pinmemberleon de boer24-Mar-14 16:06 
GeneralRe: Free fails with Access violation reading location Pinmemberpwasser24-Mar-14 16:25 
GeneralRe: Free fails with Access violation reading location Pinmemberpwasser24-Mar-14 16:59 
QuestionRe: Free fails with Access violation reading location [modified] Pinmemberpwasser24-Mar-14 16:17 
AnswerRe: Free fails with Access violation reading location Pinmembertejaswini_g24-Mar-14 16:39 
I am posting compiled code. As stated above Freelist[i] fails. Highlighted the statement causing error.
 
#include <<windows.h>> // remove extra angle bracket for compilation
#include <<tchar.h>>
#include <<stdio.h>>
#include <<strsafe.h>>
 
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]);
 
}
}
AnswerRe: Free fails with Access violation reading location Pinmemberpwasser24-Mar-14 17:01 
GeneralRe: Free fails with Access violation reading location Pinmembertejaswini_g24-Mar-14 17:11 
QuestionHow do you define flags? PinmemberDusan Paulovic24-Mar-14 10:48 
AnswerRe: How do you define flags? PinprotectorRichard MacCutchan24-Mar-14 12:11 
AnswerRe: How do you define flags? PinprofessionalAlbert Holguin25-Mar-14 5:48 
QuestionHow do I using WH_CALLWNDPROC and PT_TOUCH to get the global touch event Pinmembercedricvictor24-Mar-14 4:48 
Questionvisual studio 6.0 Enterprise edition License PinmemberKrishnaRayalu_Talisetti24-Mar-14 1:47 
AnswerRe: visual studio 6.0 Enterprise edition License PinprofessionalJochen Arndt24-Mar-14 2:02 
AnswerRe: visual studio 6.0 Enterprise edition License PinmemberDavidCrow24-Mar-14 5:51 
QuestionBuilding / compiling DirectShow "empty DLL". PinmemberVaclav_Sal23-Mar-14 6:51 
SuggestionRe: Building / compiling DirectShow "empty DLL". PinprotectorRichard MacCutchan23-Mar-14 23:59 
QuestionWin CE program, SetFong() not work Pinmemberecony21-Mar-14 8:21 
AnswerRe: Win CE program, SetFong() not work PinprofessionalRage25-Mar-14 3:15 
AnswerRe: Win CE program, SetFong() not work PinprofessionalRage25-Mar-14 3:17 
GeneralRe: Win CE program, SetFong() not work Pinmemberecony25-Mar-14 4:32 
QuestionWidth of dropdown list window Pinmemberbokideclan21-Mar-14 3:33 
QuestionVery weird change font problem Pinmemberecony20-Mar-14 9:18 
QuestionRe: Very weird change font problem Pinprofessional Randor 20-Mar-14 9:43 
AnswerRe: Very weird change font problem Pinmemberecony20-Mar-14 10:00 
AnswerRe: Very weird change font problem Pinprofessional Randor 20-Mar-14 11:22 
GeneralRe: Very weird change font problem Pinmemberecony20-Mar-14 11:33 
AnswerRe: Very weird change font problem Pinprofessional Randor 20-Mar-14 11:51 
GeneralRe: Very weird change font problem Pinmemberecony20-Mar-14 14:20 
QuestionSetfont() not work Pinmemberecony20-Mar-14 6:38 
AnswerRe: Setfont() not work Pinprofessional Randor 20-Mar-14 9:35 
GeneralRe: Setfont() not work Pinmemberecony20-Mar-14 9:42 
QuestionCEdit GetRect() question Pinmemberecony20-Mar-14 5:02 
AnswerRe: CEdit GetRect() question Pinmemberecony20-Mar-14 7:38 
QuestionCDatabase::ExecuteSQL PinmemberFawaz Ajani19-Mar-14 23:33 
SuggestionRe: CDatabase::ExecuteSQL PinprotectorRichard MacCutchan20-Mar-14 0:22 
GeneralRe: CDatabase::ExecuteSQL PinmemberFawaz Ajani20-Mar-14 2:55 
GeneralRe: CDatabase::ExecuteSQL PinprotectorRichard MacCutchan20-Mar-14 3:33 
GeneralRe: CDatabase::ExecuteSQL PinmemberFawaz Ajani20-Mar-14 6:49 
GeneralRe: CDatabase::ExecuteSQL PinmemberDavidCrow20-Mar-14 4:17 
GeneralRe: CDatabase::ExecuteSQL PinmemberFawaz Ajani20-Mar-14 6:52 
QuestionRe: CDatabase::ExecuteSQL PinmemberFawaz Ajani25-Mar-14 11:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 27 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid