 |
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Sun Feb 17, 2019 6:15 pm Post subject: Inconsistencies using USE or specific INCLUDEs |
|
|
There is some difference between using USE MSWIN and INCLUDE'ing the 3 files than make up the module MSWIN.
In the MAIN below, I use the MSWIN reference, while in the subroutine, I specifically INCLUDE the .INS files. The link step shows an unknown symbol (GetUserNameA) but only for the subroutine, not the main.
The INCLUDE'ed files win32api.ins does contain the STDCALL for GETUSERNAME that maps to the API function GetUserNameA.
MAIN
Code: |
! PROGRAM SIMPLE
winapp
PROGRAM MAIN
use mswin
character*(256) user
integer:: i,j,k
i=len(user)-1
if(getusername(user,i))continue
end
|
SUBROUTINE
Code: |
subroutine abcd(user)
include <clearwin.ins>
include <win32api.ins>
include <win32prm.ins>
character*(*) user
integer:: i,j,k
i=len(user)-1
if(getusername(user,i))continue
return
end
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8210 Location: Salford, UK
|
Posted: Fri Feb 22, 2019 2:18 pm Post subject: |
|
|
There is no immediate explanation for this. It is OK for /64.
I suggest that you provide your own interface in the form:
STDCALL GetUserNameA 'GetUserNameA' (STRING,REF):LOGICAL*4
then call GetUserNameA. |
|
Back to top |
|
 |
wahorger

Joined: 13 Oct 2014 Posts: 1257 Location: Morrison, CO, USA
|
Posted: Fri Feb 22, 2019 4:09 pm Post subject: |
|
|
John, yes, it works fine with USE MSWIN for all instances.
I discovered this as I integrated another routine and had left the INCLUDE's in place, versus the USE.
Paul, I've scanned all the routines and no more occurrences. I'll continue to USE MSWIN. I point this out only for its "bugginess". |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|