char* passed to a function
PHP Code:
BOOL pmRetrieveComboText (HWND hWndCombo, char* dest)
{
UINT idx; //current index
UINT len; //length of index text
char* ret = '\0'; //the value to return
idx = SendMessage (hWndCombo, CB_GETCURSEL, NULL, NULL);
len = SendMessage (hWndCombo, CB_GETLBTEXTLEN, idx, NULL);
if ((idx == -1) || (len == -1)) return 0;
ret = new char[len + 1]; //allocate the necessary memory
//fill the allocated array with the item text
SendMessage (hWndCombo, CB_GETLBTEXT, idx, (LPARAM) ret);
dest = ret;
delete[] ret;
return TRUE;
}
why wont this function change dest? i basically wanna to pass a char* by reference, but it doesm't change anything...can anyone help?
thanks