I have some simple but troublesome code
the compiled exe crashes(silent) when i se the read string function but write string is OK
here is my example dbp code
ptr AS DWORD
ptr=make memory(100)
wait key
write string to pointer ptr,"H"
wait key
tmp$=read string from pointer(ptr) `crashes here
`wait key
print tmp$
delete memory ptr
`print t
`close shared memory 1,ptr
wait key
and heres my also very simple code
DWORD dbpstring(LPSTR pstring) //handy little function to return strings, I'm thinking the problem is here
{
LPSTR pret=NULL;
DWORD dwSize=strlen((LPSTR)pstring );
g_pGlob->CreateDeleteString ( (DWORD*)&pret, dwSize+1 );
strcpy(pret, (LPSTR)pstring);
return (DWORD) pret;
}
DWORD ReadString(DWORD ptr){ //reads a string from ptr till a null
return dbpstring((LPSTR)ptr); //well that was easy
}
thanks in advance
edit:
I'm also thinking that dbp's strings aren't null terminated which would make the crash make sense
I didnt fail, I just found 10,000 ways that don't work
-Thomas Edison