[lazarus] wince GetControlText
when i try to use the Text property in the edit control as the text in a MessageDlg function, it gives me a Bus error or misaligned data access error. i tracked this down to be the FreeMem(tmpWideStr) call in the GetControlText function. it makes sense to me to use the SysFreeString function when you've used SysAllocStringLen - and when i changed this to SysFreeString(tmpWideStr), it started working. can any wince geniuses confirm this? this is on line 1135 in winceproc.pp. i'd just like to quote an hilariously vague line out of msdn: Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application. this is on the SysAllocStringLen page - a function which is supposed to be able to handle a null param... henry _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wince GetControlText
I posted as bug in mantis, and worked fine for me, but not sure if that the correct way to resovle the problem, i think when we use SysAllocStringLen we must use SysFreeString. Check it http://www.freepascal.org/mantis/view.php?id=8676 --- Henry Vermaak [EMAIL PROTECTED] wrote: when i try to use the Text property in the edit control as the text in a MessageDlg function, it gives me a Bus error or misaligned data access error. i tracked this down to be the FreeMem(tmpWideStr) call in the GetControlText function. it makes sense to me to use the SysFreeString function when you've used SysAllocStringLen - and when i changed this to SysFreeString(tmpWideStr), it started working. can any wince geniuses confirm this? this is on line 1135 in winceproc.pp. i'd just like to quote an hilariously vague line out of msdn: Passing invalid (and under some circumstances NULL) pointers to this function causes an unexpected termination of the application. this is on the SysAllocStringLen page - a function which is supposed to be able to handle a null param... henry _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] wince GetControlText
On 13/04/07, zaher dirkey [EMAIL PROTECTED] wrote: I posted as bug in mantis, and worked fine for me, but not sure if that the correct way to resovle the problem, i think when we use SysAllocStringLen we must use SysFreeString. Check it http://www.freepascal.org/mantis/view.php?id=8676 that's it. sorry, i need to search mantis before i post anything here. it'd save me some time. henry _ To unsubscribe: mail [EMAIL PROTECTED] with unsubscribe as the Subject archives at http://www.lazarus.freepascal.org/mailarchives