Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chidambaram

macrumors member
Original poster
Mar 9, 2008
67
0
hi all,

i am working in a carbon c++ application using XCODE.

I want to set text to the text box.

I written the code.

It returns the follwing error.

How can i rectify this?

my code is

void setdataintextbox(char* settingstring, ControlID controlID)
{

ControlRef editField;

GetControlByID(receiverwindow, &controlID, &editField);

CFStringRef labelMsg = CFStringCreateWithCString (NULL, settingstring, CFStringGetSystemEncoding());

SetControlData(editField, kControlNoPart, kControlEditTextCFStringTag, sizeof(labelMsg), &labelMsg);

Draw1Control(editField);

CFRelease(labelMsg);

}

I call this function as

char sendername[512];
strcpy(sendername,"chidambaram");
char dest21[512];
printf("\n before cpy");
strcpy(dest21,sendername);
setdataintextbox(dest21,idControl);


I get the error as

Carbon_ODBC_Example(2590,0x184fa00) malloc: *** Deallocation of a pointer not malloced: 0xffffffff; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

Carbon_ODBC_Example is my program name.

how can i solve this error?

thanks in advance
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.