TextFromWindow(GetDlgItem(hwnd, EDITAR_ED_OBSERVACOES), backup_ficha->observacoes);
...
int TextFromWindow(HWND hwnd, char * text)
{
int size = GetWindowTextLength(hwnd)+1;
text = malloc(size);
GetWindowText(hwnd, text, size);
return size;
}
At "text = malloc(size);" memory is allocated to text but in "GetWindowText(hwnd, text, size-1);" text lose the allocation.
I don't know what is wrong.