Page 1 sur 1
purebasic BUG
Publié : lun. 29/févr./2016 4:18
par zgneng1
Code : Tout sélectionner
q.l= CreateFile_("c:\888.txt", #GENERIC_READ, 0, 0, #OPEN_ALWAYS, #FILE_ATTRIBUTE_NORMAL, 0)
Global a.s{10000000}
Debug q
ReadFile_(q, @a, 9, #Null, #Null)
Do not use the PUREBASIC function(CreateFile AND ReadFile)
Using windows APi(CreateFile_,ReadFile)_
You will find BUG
Re: purebasic BUG
Publié : lun. 29/févr./2016 7:12
par Marc56
CreateFile
_ and ReadFile
_ are not PureBasic functions, these are API, so ask Microsoft (or Linux, or Apple) support.
Use API directly requires often additional checks to be secure, so always prefere PureBasic internal functions when exist.
Your sample use CreateFile_ so API direct, not PurebBasic function.
Normal users do not have the right to write to the root of a system, all programmers know that from Windows Vista. Need admin rights.
No one programmer uses function 'Createfile()' or any I/O function on disk without prior verification (
if CreateFile())
PureBasic does not have Try/Catch mechanism, but have
OnError lib to trap errors. But in all cases, IF is the easiest and fastest way to avoid error.
Please do not crosspost same question on us and french forum, It is useless.

Re: purebasic BUG
Publié : lun. 29/févr./2016 7:56
par Ar-S
Hi zgneng1, Marc56's right. .
As in concern your question, please try to use google translate to speak about your problem in french on this forum.
Thanks.
@Marc56
Salut marc, je suis d'accord avec toi sauf pour ta dernière ligne. Je ne vois pas pourquoi on ne pourrait pas poser une question sur plusieurs forums.. ça nous est tous arrivé.
Re: purebasic BUG
Publié : lun. 29/févr./2016 8:22
par Fred
Ne repondez pas à ce troll, il spam le forum anglais aussi. Locké.