Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Comparison in VFP6 & VFP9
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01150666
Message ID:
01150668
Views:
26
Hi Tariq,

What return GetLastError()?
DECLARE INTEGER GetLastError IN kernel32 

IF SetFileAttributes (LCFILE, BITOR(lnFileAttributes, FILE_ATTRIBUTE_READONLY)) = 0
* Error setting attributes
   ?GetLastError()
	RETURN .F.
ENDIF
IF lnFileAttributes = -1
   ?GetLastError()
	RETURN .F.
ENDIF

MartinJ
>Dear Experts
>
>Flolloiwng codes are a part of my startup (main) prg.
>
>1-When I run bulid exe in VFP6, it work fine
>2-When I build exe in VFP9, it flushes and nothing happend.
>3-While removing these codes when I build exe in VFP9 then it work fine.
>
>What is wrong? If these codes do not work in VFP9, Please edit.
>
>Thanks in advance
>
>
>&& To make exe readonly attribute
>LCFILE=curdir()+"ACCOUNTS.EXE"
>#DEFINE FILE_ATTRIBUTE_READONLY 	0x01
>#DEFINE FILE_ATTRIBUTE_HIDDEN	0x02
>#DEFINE FILE_ATTRIBUTE_SYSTEM	0x04
>#DEFINE FILE_ATTRIBUTE_DIRECTORY	0x10
>#DEFINE FILE_ATTRIBUTE_ARCHIVE	0x20
>#DEFINE FILE_ATTRIBUTE_NORMAL	0x80
>#DEFINE FILE_ATTRIBUTE_TEMPORARY	0x0100
>DECLARE LONG SetFileAttributes IN WIN32API STRING FileName, LONG FileAttributes
>DECLARE LONG GetFileAttributes IN WIN32API STRING FileName
>lnFileAttributes = GetFileAttributes (LCFILE)
>IF SetFileAttributes (LCFILE, BITOR(lnFileAttributes, FILE_ATTRIBUTE_READONLY)) = 0
>* Error setting attributes
>	RETURN .F.
>ENDIF
>IF lnFileAttributes = -1
>	RETURN .F.
>ENDIF
>
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform