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 

cannot link GET_PROCESS_ID@

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
Thomas



Joined: 18 Feb 2005
Posts: 56
Location: Gummersbach, Germany

PostPosted: Mon Feb 18, 2019 5:59 pm    Post subject: cannot link GET_PROCESS_ID@ Reply with quote

Today I tried to use

GET_PROCESS_ID@

with FTN95 Version 8.40.0 applying the following coding

program id
implicit none
INCLUDE <WINDOWS.INS>
integer idx
call get_process_id@(idx)
end


When linking with slink the following message is shown:
WARNING the following symbols are missing:
__get_process_id


Other ClearWin functions are properly linked and operating well.
_________________
Thomas
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Mon Feb 18, 2019 10:37 pm    Post subject: Reply with quote

This function is in

CLEARWIN.INS
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Feb 19, 2019 12:23 am    Post subject: Reply with quote

Bill,

WINDOWS.INS has the 3 following lines:

INCLUDE <CLEARWIN.INS>
INCLUDE <WIN32API.INS>
INCLUDE <WIN32PRM.INS>

so INCLUDE <WINDOWS.INS> contains <CLEARWIN.INS>

Eddie
Back to top
View user's profile Send private message
wahorger



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

PostPosted: Tue Feb 19, 2019 4:32 am    Post subject: Reply with quote

So.....

What's his answer, then?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Feb 19, 2019 8:48 am    Post subject: Reply with quote

GET_PROCESS_ID@ and GET_PROCESS_HANDLE@ are only available in clearwin64.dll (for 64 bit compilations). This information should have appeared in cwplus.enh and I have now made the correction.

They are very specialised routines that allow you to provide an address into which the ID or HANDLE is planted when a process on another thread is started.

It is possible that the Windows API functions GetProcessId or GetCurrentProcessId should be considered instead.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Tue Feb 19, 2019 11:52 am    Post subject: Reply with quote

Bill,

Paul has the answer. In cases where I don't know the answer, I sometimes know what the answer isn't. In this case, the answer isn't to INCLUDE <CLEARWIN.INS>, because <WINDOWS.INS> contains it already.

Or, to quote from Holmes: 'How often have I said to you that when you have eliminated the impossible, whatever remains, however improbable, must be the truth?'

The exclusion of impossibles is one route to the discovery of the truth.

Eddie
Back to top
View user's profile Send private message
Thomas



Joined: 18 Feb 2005
Posts: 56
Location: Gummersbach, Germany

PostPosted: Tue Feb 19, 2019 4:38 pm    Post subject: Reply with quote

Thank you all for your support!

As indicated by Paul, the answer is much easier than expected.

The following code provides the solution:

program id
implicit none
INCLUDE <WINDOWS.INS>
Integer :: idx
idx = GETCURRENTPROCESSID()
write (*,*) idx
end program


Or one can extract the STDCALL declaration from the WINDOWS.INS file and receive:

program id
implicit none
STDCALL GETCURRENTPROCESSID 'GetCurrentProcessId':INTEGER*4
Integer :: idx
idx = GETCURRENTPROCESSID()
write (*,*) idx
end program

_________________
Thomas
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 -> ClearWin+ 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