Silverfrost Forums

Welcome to our forums

cannot link GET_PROCESS_ID@

18 Feb 2019 4:59 #23259

Today I tried to use

[color=red:030776e83f]GET_PROCESS_ID@[/color:030776e83f]

with FTN95 Version 8.40.0 applying the following coding

[color=red:030776e83f]program id implicit none INCLUDE <WINDOWS.INS> integer idx call get_process_id@(idx) end[/color:030776e83f]

When linking with slink the following message is shown: [color=red:030776e83f]WARNING the following symbols are missing: __get_process_id[/color:030776e83f]

Other ClearWin functions are properly linked and operating well.

18 Feb 2019 9:37 #23260

This function is in

CLEARWIN.INS

18 Feb 2019 11:23 #23261

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

19 Feb 2019 3:32 #23262

So.....

What's his answer, then?

19 Feb 2019 7:48 #23263

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.

19 Feb 2019 10:52 #23264

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

19 Feb 2019 3:38 #23265

Thank you all for your support!

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

The following code provides the solution:

[color=red:c4962ce764]program id implicit none INCLUDE <WINDOWS.INS> Integer :: idx idx = GETCURRENTPROCESSID() write (,) idx end program [/color:c4962ce764]

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

[color=red:c4962ce764]program id implicit none STDCALL GETCURRENTPROCESSID 'GetCurrentProcessId':INTEGER4 Integer :: idx idx = GETCURRENTPROCESSID() write (,*) idx end program[/color:c4962ce764]

Please login to reply.