View previous topic :: View next topic |
Author |
Message |
Thomas
Joined: 18 Feb 2005 Posts: 56 Location: Gummersbach, Germany
|
Posted: Mon Feb 18, 2019 5:59 pm Post subject: cannot link GET_PROCESS_ID@ |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Mon Feb 18, 2019 10:37 pm Post subject: |
|
|
This function is in
CLEARWIN.INS |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Tue Feb 19, 2019 12:23 am Post subject: |
|
|
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 |
|
|
wahorger
Joined: 13 Oct 2014 Posts: 1217 Location: Morrison, CO, USA
|
Posted: Tue Feb 19, 2019 4:32 am Post subject: |
|
|
So.....
What's his answer, then? |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7938 Location: Salford, UK
|
Posted: Tue Feb 19, 2019 8:48 am Post subject: |
|
|
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 |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2391 Location: Yateley, Hants, UK
|
Posted: Tue Feb 19, 2019 11:52 am Post subject: |
|
|
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 |
|
|
Thomas
Joined: 18 Feb 2005 Posts: 56 Location: Gummersbach, Germany
|
Posted: Tue Feb 19, 2019 4:38 pm Post subject: |
|
|
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 |
|
|
|