forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inconsistencies using USE or specific INCLUDEs

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 559
Location: Morrison, CO, USA

PostPosted: Sun Feb 17, 2019 6:15 pm    Post subject: Inconsistencies using USE or specific INCLUDEs Reply with quote

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
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 1058
Location: Aerospace Valley

PostPosted: Fri Feb 22, 2019 9:41 am    Post subject: Reply with quote

I assume it works OK when you put USE MSWIN in the subroutine too ?
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 5792
Location: Salford, UK

PostPosted: Fri Feb 22, 2019 2:18 pm    Post subject: Reply with quote

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
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 559
Location: Morrison, CO, USA

PostPosted: Fri Feb 22, 2019 4:09 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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