gfxgfx
 
Please login or register.

Login with username, password and session length
 
gfx gfx
gfx
1617 Posts in 535 Topics by 779 Members - Latest Member: rhoronjeff@comcast.net November 27, 2022, 09:21:51 PM
*
gfx* Home | Help | Search | Login | Register | gfx
gfx
Absoft User Forum  |  Support  |  Windows  |  Accessing COMMON variables
gfx
gfxgfx
 

Author Topic: Accessing COMMON variables  (Read 5704 times)

kpreid

  • Newbie
  • *
  • Posts: 2
Accessing COMMON variables
« on: July 18, 2007, 12:20:11 PM »
I need to pass data to a FORTRAN app that is already running (i.e. the data can't be passed in a command line argument).  If I create a C DLL that has access to and sets a value in a COMMON block in the FORTRAN (and is part of the FORTRAN app's project), and call that DLL from another app, will the data get passed along to the FORTRAN app?? 

Mike Linacre

  • Sr. Member
  • ****
  • Posts: 259
Re: Accessing COMMON variables
« Reply #1 on: July 18, 2007, 07:27:46 PM »
Kpried: dlls are only supposed to be shareable read-only code. There are many methods of inter-task communication under Windows. API SendMessage, posting to the Windows Registry, writing a disk file. With SendMessage the challenge is identifying the Window to which you want to send the message. API call EnumWindows helps.

ColinC

  • Newbie
  • *
  • Posts: 5
Re: Accessing COMMON variables
« Reply #2 on: July 25, 2007, 04:57:50 AM »
I agree: write to a file.  main code should take routine peeks to see if a "data available" flag has been set.  This will work under any operating system, but if you use a Windows API then you're stuck with Windows.  (I know, you don't 'intend' to migrate it.)  Regards, ColinC

Absoft User Forum  |  Support  |  Windows  |  Accessing COMMON variables
 

gfxgfx
gfx gfx
Powered by MySQL Powered by PHP Valid XHTML 1.0! Valid CSS!