Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp9 app in 64 bit OS
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Miscellaneous
Thread ID:
01485657
Message ID:
01486216
Views:
75
I have a VFP 7 app running just fine in Windows 7.
Some notes that I have run into.
Corporate Environment they don't let users be administrators of their machines. Non administrators cannot write to the root of C:\
The return from the GetUserName function that Sergey wrote returns a different result in Windows 7 than XP. I guess Windoes 7 is Web based and puts all the \\Server96\(other junk) in the return you need to operate on the return tu get the user ID.
DECLARE INTEGER WNetGetUser IN Win32API STRING @, STRING @, INTEGER @
cUserName = SPACE(261)
 lres = WNetGetUser('U:', @cUserName, 261)
IF lres = 0 .and. ( at("\", cUserName) > 0 )
	* remove the "DOMAIN1/"		Windows7 need to look for the / character
	* first remove the path preceding the username
	cUserName = substr(cUserName,at("\", cUserName)+1)
	Thisform.cusername = PADR(UPPER(left(cUserName,at(chr(0),cUserName) -1)),8)
ELSE
   Thisform.cusername = "Visitor"
ENDIF
cname = thisform.cusername	&& cname is public in the main program and needed in pshutfdown to log off
HTH
Ron Seidl
Independent Developer
VFP

"I'm playing in life's theater in anticipation of a great cast party!"
Previous
Reply
Map
View

Click here to load this message in the networking platform