The original idea was that I was going to make some "macros" so
that I could get and put any powerbasic type to and from an edit
box.
Code:
GetItemByte GetItemWord GetItemDword GetItemInteger GetItemLong GetItemQuad GetItemSingle GetItemDouble GetItemString GetItemAsciiz PutItemByte PutItemWord PutItemDword PutItemInteger PutItemLong PutItemQuad PutItemSingle PutItemDouble PutItemString PutItemAsciiz
full allocated length of the string. That way I could make sure
that I dont retrieve more string data then there is string space.
I solved the problem by just adding another variable to the string
functions...
Code:
function GetItemAsciiz(byval hDlg as long, byval ID as long, Buffer as asciiz, byval Length as long) as long function = SendMessage(GetDlgItem(hDlg,ID), %WM_GETTEXT, Length, varptr(Buffer)) end function function PutItemAsciiz(byval hDlg as long, byval ID as long, Buffer as asciiz) function = SendMessage(GetDlgItem(hDlg,ID), %WM_SETTEXT, 0, varptr(Buffer)) end function
------------------
Cheers
[This message has been edited by mark smit (edited November 29, 2000).]
Leave a comment: