Dear R-devel,

 

I would like to launch the Rgui.exe from a Fortran console application (we
will call this FortranCon.exe), that I have written myself. To do this, I
send the command line "C:\Program Files\R\R-X.X.X\Rgui.exe" (where X.X.X is
the version number) as an argument to the
Windows API function CreateProcess (see
http://msdn.microsoft.com/en-us/library/ms682425(VS.85).aspx) 

 

I use the createprocess command because I want the Rgui.exe and the Fortran
console application to run in parallel. 

 

I have done this before with other executables (e.g. Tinn-R.exe,
textpad.exe) and there hasn't been a problem.

 

But with the current version of R(v2.9.1), there is a problem. 

 

The problem is that after Rgui.exe is launched by FortranCon.exe, the
console window for FortanCon.exe does not close properly when it finishes
running. 

I have to manually close it, by clicking on the topright X on the window.
When I do this the Rgui.exe window also closes - which again is different to
normal, and then the Windows EndProgram dialog comes up and asks me whether
I wish to close FortranCon.exe

 

I have experimented with different versions of R, and this problem only
occurs in R(>=v2.7.0)

 

If I launch Rgui.exe for v2.6.2, then the FortranCon.exe window closes
automatically when it finishes and the Rgui.exe window remains open - this
is the behaviour I expect and want to happen. Indeed, this is what usually
happens If I launch other executables using the CreateProcess function.

 

This error does not occur if I launch Rgui.exe from a Fortran windows
application. (as opposed to console application) 

 

I am running R on Windows XP (Service Pack 3) 32-bit (I have also found the
problem occurs using 64-bit Windows XP). The FortranCon.exe is complied and
linked by Intel Visual Fortran IVF11.1.035 and Visual Studio 2008.

 

So my query is. What has changed in the R Windows interface from v2.6.2 to
v2.7.0 to cause this problem. I had a look at the CHANGES for R2.7.0 and I
couldn't see anything the instantly could cause this problem. 

 

Any help on this matter is greatly appreciated. 

 

The ability to launch R from a Fortran application is important for the
usability of the RFortran software library (www.rfortran.org
<http://www.rfortran.org/> ) that we are developing. 

 

Cheers,

Mark

 

_________________________________________________

Dr Mark Thyer

Senior Lecturer in Environmental Engineering

Discipline of Civil, Surveying and Environmental Engineering

School of Engineering, University of Newcastle

Callaghan, NSW, Australia 2308

T: 02 4921 6057

F: 02 4921 6991

E: mark.thyer@newcastle.edu.au

W:
www.newcastle.edu.au/school/engineering/our_staff/profiles/thyer_mark.html

 

"It is easy to lie with statistics, but it is difficult to tell the truth
without them." Andrejs Dunkels

 

 

 

 

 


	[[alternative HTML version deleted]]

