Hello,
has someone a code for using memory ?
i can't get it to run with GLOBALMEM ALLOC.
has someone a code for using memory ?
i can't get it to run with GLOBALMEM ALLOC.
#COMPILE EXE #DIM ALL #INCLUDE "win32api.inc" '#INCLUDE "hexdump.inc" FUNCTION PBMAIN () AS LONG LOCAL p AS BYTE PTR LOCAL hgmem, lresult AS DWORD LOCAL s AS STRING LOCAL pdw, pmem AS DWORD PTR s = STRING$(100,&H39) p = STRPTR(s) GLOBALMEM ALLOC 1000 TO hgmem ? "allocated" + STR$(hgmem),%MB_TASKMODAL GLOBALMEM LOCK hgmem TO pmem ? "locked" + STR$(pmem),%MB_TASKMODAL movememory @pmem, p, 100 ? "moved",%MB_TASKMODAL 'hexdump(@pmem, 100) GLOBALMEM UNLOCK hgmem TO lresult ? "unlocked",%MB_TASKMODAL IF lresult <> 0 THEN ? "error unlocking memory",%MB_TASKMODAL GLOBALMEM FREE hgmem TO lresult ? "freed",%MB_TASKMODAL IF lresult <> 0 THEN ? "error freeing memory",%MB_TASKMODAL END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment