Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

GetUserName() error

gelarimer
Beginner
953 Views

I am using the 9.1 compiler and the XP operating system. The following codesegment compiles and links OK, but when executed the call to GetUserName() produces an Unhandled Exception, Access Violation Reading Location .....

INTEGER(4) iret, iSize
CHARACTER(50) szText

iSize = 50

iret = GetUserName(szText, iSize)

Any comments would be appreciated.

0 Kudos
2 Replies
Steven_L_Intel1
Employee
953 Views
Pass loc(iSize). The interface defined in ADVAPI32 declares that argument as an address passed by value. I'll see about getting that improved.
0 Kudos
gelarimer
Beginner
953 Views
Thanks Steve. Using Loc(iSize) worked fine.
0 Kudos
Reply