Click here to Skip to main content
15,906,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDrag and drop through group controls? Pin
Dominik Reichl14-Jun-08 0:05
Dominik Reichl14-Jun-08 0:05 
AnswerRe: Drag and drop through group controls? Pin
Jagdish V. Bhimbha14-Jun-08 0:25
Jagdish V. Bhimbha14-Jun-08 0:25 
AnswerRe: Drag and drop through group controls? Pin
tsy1986030314-Jun-08 3:13
tsy1986030314-Jun-08 3:13 
GeneralRe: Drag and drop through group controls? Pin
Hamid_RT15-Jun-08 5:34
Hamid_RT15-Jun-08 5:34 
AnswerRe: Drag and drop through group controls? Pin
Saurabh.Garg14-Jun-08 18:39
Saurabh.Garg14-Jun-08 18:39 
GeneralRe: Drag and drop through group controls? Pin
Dominik Reichl14-Jun-08 22:05
Dominik Reichl14-Jun-08 22:05 
GeneralRe: Drag and drop through group controls? Pin
Saurabh.Garg14-Jun-08 23:32
Saurabh.Garg14-Jun-08 23:32 
QuestionHeap Corruption error Pin
syntax28uk13-Jun-08 20:42
syntax28uk13-Jun-08 20:42 
Hi,

Can somebody please point out why I'm getting a heap corruption error for the below code? I'm free all of the resources I've allocated with malloc.

Thanks

void TestMultiDim()
{
	char** mArray;
	int rows = 50;
	char* p;
	char* q;
	int i;
	char* data = "John Doe";
	size_t len;
	len = rows * sizeof(char*);
	mArray = (char **)malloc(len);
	if(mArray == NULL)
	{
		exit(EXIT_FAILURE);
	}

	//Create the sub arrays
	//for(p = mArray; *p!='\0'; p++)
	for(i = 0; i < rows; i++)
	{
		//*p = (char*)malloc(len);
		mArray[i] = (char*)malloc(len);
		//if(*p == NULL)
		if(mArray[i] == NULL)
		{
			exit(EXIT_FAILURE);
		}
		//memset(*p, 0, len);
	}

	//Populate Data
	//for(p = mArray; *p !='\0'; p++)
	for(i = 0; i < rows; i++)
	{
		mArray[i] = data;
		//*p = data;
	}

	//Print out List
	//for(p = mArray; *p !='\0'; p++)
		for(i = 0; i < rows; i++)
	{
		printf("%s\n", mArray[i]);
	}


	//Clean Up:
	for(i = 0; i < rows; i++)
	{
		free(mArray[i]);
		mArray[i] = NULL;
	}
	free(mArray);

}

AnswerRe: Heap Corruption error Pin
Saurabh.Garg13-Jun-08 21:45
Saurabh.Garg13-Jun-08 21:45 
GeneralRe: Heap Corruption error Pin
syntax28uk13-Jun-08 22:13
syntax28uk13-Jun-08 22:13 
GeneralRe: Heap Corruption error Pin
Saurabh.Garg14-Jun-08 4:12
Saurabh.Garg14-Jun-08 4:12 
QuestionResizable Propertysheet. Pin
Le@rner13-Jun-08 19:54
Le@rner13-Jun-08 19:54 
AnswerRe: Resizable Propertysheet. [modified] Pin
Nibu babu thomas13-Jun-08 21:45
Nibu babu thomas13-Jun-08 21:45 
GeneralRe: Resizable Propertysheet. Pin
Le@rner13-Jun-08 22:01
Le@rner13-Jun-08 22:01 
QuestionRe: Resizable Propertysheet. Pin
David Crow14-Jun-08 4:22
David Crow14-Jun-08 4:22 
AnswerRe: Resizable Propertysheet. Pin
Le@rner15-Jun-08 18:02
Le@rner15-Jun-08 18:02 
QuestionDebug problem with VC6 on Vista x64 Pin
Kevin 123341213-Jun-08 10:09
Kevin 123341213-Jun-08 10:09 
AnswerRe: Debug problem with VC6 on Vista x64 Pin
Michael Dunn13-Jun-08 10:59
sitebuilderMichael Dunn13-Jun-08 10:59 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Kevin 123341213-Jun-08 11:22
Kevin 123341213-Jun-08 11:22 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Saurabh.Garg14-Jun-08 18:41
Saurabh.Garg14-Jun-08 18:41 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Kevin 123341216-Jun-08 8:08
Kevin 123341216-Jun-08 8:08 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Hamid_RT15-Jun-08 5:33
Hamid_RT15-Jun-08 5:33 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Kevin 123341216-Jun-08 8:11
Kevin 123341216-Jun-08 8:11 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Hamid_RT16-Jun-08 20:09
Hamid_RT16-Jun-08 20:09 
GeneralRe: Debug problem with VC6 on Vista x64 Pin
Kevin 123341217-Jun-08 8:33
Kevin 123341217-Jun-08 8:33 

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.