merging fortran executable with a VB executable 
Author Message
 merging fortran executable with a VB executable

I have a VB program that prepares all necessary
inputs for a fortran executable file. But in this way
I have two executables: a VB one and a fortran one.
Is there a way to combine the two to make a single
executable? Can I link the fortran object code to a
VB project? If yes, how?

Thanks for any help in this regards.

Farooq



Sat, 08 May 2004 04:00:10 GMT  
 merging fortran executable with a VB executable

Quote:

> I have a VB program that prepares all necessary
> inputs for a Fortran executable file. But in this way
> I have two executables: a VB one and a fortran one.
> Is there a way to combine the two to make a single
> executable? Can I link the fortran object code to a
> VB project? If yes, how?

> Thanks for any help in this regards.

> Farooq

I've not seen that done.  I doubt the fortran obj could be linked to a
VB project.

You could recode the fortran program into the VB one (or vice-versa)
if you have the source code.  You could leave it as 2 exes but have
the VB 'control' the fortran one by shelling.

Good luck.



Sat, 08 May 2004 21:34:36 GMT  
 merging fortran executable with a VB executable

Quote:


> > I have a VB program that prepares all necessary
> > inputs for a Fortran executable file. But in this way
> > I have two executables: a VB one and a fortran one.
> > Is there a way to combine the two to make a single
> > executable? Can I link the fortran object code to a
> > VB project? If yes, how?

> > Thanks for any help in this regards.

> > Farooq

> I've not seen that done.  I doubt the fortran obj could be linked to a
> VB project.

> You could recode the fortran program into the VB one (or vice-versa)
> if you have the source code.  You could leave it as 2 exes but have
> the VB 'control' the fortran one by shelling.

> Good luck.

It <can> be done by turning the Fortran code into a dll or linking with
explicit interfaces.  
You don't say whose compiler(s) nor what data structures you are using,
so I don't have any way to provide further real details.  If using the
MS or CVF compilers, see reference manual on interlanguage
programming...there are good examples of most interfaces.  (BTW, it is
<possible> to use Fortran as the main program, but <much> more difficult
than the other way 'round, so you'll only find examples with VB as the
main program.)

HTH, and post with further details if desired, I'll be happy to try to
help...



Sat, 08 May 2004 23:00:04 GMT  
 merging fortran executable with a VB executable
I am using MSVB 6 and Digital fortran 5

Perhaps another possible solution would be to be able to pass arguments
to the fortran program?

I use the following command in VB to execute the fortran excutable

Shell(currentdir + "Carda.exe ", 2)

------------------------------------the VB subroutine where it is used ----
Private Sub run_button_Click()
Dim reponse
openmode% = savefile
filenum% = 1
Call save_geo(currentdir + "GEOM.DAT", openmode%, filenum%)
Call save_ctrl(currentdir + "CTRL.DAT", openmode%, filenum%)
Call save_opera(currentdir + "OPERA.DAT", openmode%, filenum%)
reponse = Shell(currentdir + "Carda.exe ", 2)
----------------------------------------------------end------------------

here currentdir is where the program is run from.

Here Carda.exe is the fortran executable. I want to pass two arguments
to Carda.exe, let's say date and hostid? How can I do that? This will be
another solution to my problem.

Thanks for any help in this regards.

Farooq

Quote:



> > > I have a VB program that prepares all necessary
> > > inputs for a Fortran executable file. But in this way
> > > I have two executables: a VB one and a fortran one.
> > > Is there a way to combine the two to make a single
> > > executable? Can I link the fortran object code to a
> > > VB project? If yes, how?

> > > Thanks for any help in this regards.

> > > Farooq

> > I've not seen that done.  I doubt the fortran obj could be linked to a
> > VB project.

> > You could recode the fortran program into the VB one (or vice-versa)
> > if you have the source code.  You could leave it as 2 exes but have
> > the VB 'control' the fortran one by shelling.

> > Good luck.

> It <can> be done by turning the Fortran code into a dll or linking with
> explicit interfaces.
> You don't say whose compiler(s) nor what data structures you are using,
> so I don't have any way to provide further real details.  If using the
> MS or CVF compilers, see reference manual on interlanguage
> programming...there are good examples of most interfaces.  (BTW, it is
> <possible> to use Fortran as the main program, but <much> more difficult
> than the other way 'round, so you'll only find examples with VB as the
> main program.)

> HTH, and post with further details if desired, I'll be happy to try to
> help...

--
Assalaamu Alaikum

Wa alaikum assalaam
Regards
Farooq Saeed
__________________________________________
Office: cole Polytechnique de Montral
        Dpartment de Gnie Mcanique
        C. P. 6079, succ. Centre-ville
        Montral (Qubec), Canada
        H3C 3A7
        (514) 340-4711 ext. 5870

Fax:    (514) 340-5917

WWW:    http://www.meca.polymtl.ca/farooq/

Home:   5335 Patricia ave., Apt. B,
        Montral (Qubec), Canada
        H4V 1Z1
        (514) 484-5309
__________________________________________



Sat, 08 May 2004 23:50:06 GMT  
 merging fortran executable with a VB executable
With these, it <should> be no problem linking, although DVC 5 is now
pretty old (and now is Compaq Visual Fortran (CVF) on version 6+).

You can use either solution--shell with parameters or make the function
of the Fortran program a linkable subroutine.  My personal preference
(admitting I don't know your ultimate objective) would be to add the
functionality directly into the VB program, not to use an external
process.  However, you don't indicate what "carda.exe" is doing...I
assume it doesn't return a result as it is a standalone .exe, but it
must have some interaction or it wouldn't matter whether it runs or not
<g>....

I'm not sure about the examples in DVF 5, but I'm pretty sure the
current examples are available on the Compaq web site.  With V5, I'm not
sure you'll be able to use the IDE to build the project, but you can
compile from the command line.  You can turn the main program into a
subroutine and pass a pair of character variables containing the desired
parameters to it.  See the section of "Interlanguage programming" in the
help files.

Alternatively, to simply pass the arguments to the program, look at the
DVF extensions ARGC and friends.

HTH...

Quote:

> I am using MSVB 6 and Digital fortran 5

> Perhaps another possible solution would be to be able to pass arguments
> to the fortran program?

> I use the following command in VB to execute the fortran excutable

> Shell(currentdir + "Carda.exe ", 2)

> ------------------------------------the VB subroutine where it is used ----
> Private Sub run_button_Click()
> Dim reponse
> openmode% = savefile
> filenum% = 1
> Call save_geo(currentdir + "GEOM.DAT", openmode%, filenum%)
> Call save_ctrl(currentdir + "CTRL.DAT", openmode%, filenum%)
> Call save_opera(currentdir + "OPERA.DAT", openmode%, filenum%)
> reponse = Shell(currentdir + "Carda.exe ", 2)
> ----------------------------------------------------end------------------

> here currentdir is where the program is run from.

> Here Carda.exe is the fortran executable. I want to pass two arguments
> to Carda.exe, let's say date and hostid? How can I do that? This will be
> another solution to my problem.

> Thanks for any help in this regards.

> Farooq




> > > > I have a VB program that prepares all necessary
> > > > inputs for a Fortran executable file. But in this way
> > > > I have two executables: a VB one and a fortran one.
> > > > Is there a way to combine the two to make a single
> > > > executable? Can I link the fortran object code to a
> > > > VB project? If yes, how?

> > > > Thanks for any help in this regards.

> > > > Farooq

> > > I've not seen that done.  I doubt the fortran obj could be linked to a
> > > VB project.

> > > You could recode the fortran program into the VB one (or vice-versa)
> > > if you have the source code.  You could leave it as 2 exes but have
> > > the VB 'control' the fortran one by shelling.

> > > Good luck.

> > It <can> be done by turning the Fortran code into a dll or linking with
> > explicit interfaces.
> > You don't say whose compiler(s) nor what data structures you are using,
> > so I don't have any way to provide further real details.  If using the
> > MS or CVF compilers, see reference manual on interlanguage
> > programming...there are good examples of most interfaces.  (BTW, it is
> > <possible> to use Fortran as the main program, but <much> more difficult
> > than the other way 'round, so you'll only find examples with VB as the
> > main program.)

> > HTH, and post with further details if desired, I'll be happy to try to
> > help...

> --
> Assalaamu Alaikum

> Wa alaikum assalaam
> Regards
> Farooq Saeed
> __________________________________________
> Office: cole Polytechnique de Montral
>         Dpartment de Gnie Mcanique
>         C. P. 6079, succ. Centre-ville
>         Montral (Qubec), Canada
>         H3C 3A7
>         (514) 340-4711 ext. 5870

> Fax:    (514) 340-5917

> WWW:    http://www.meca.polymtl.ca/farooq/

> Home:   5335 Patricia ave., Apt. B,
>         Montral (Qubec), Canada
>         H4V 1Z1
>         (514) 484-5309
> __________________________________________



Sun, 09 May 2004 02:28:54 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Shrinking Windows executables and Stand-alone VB executables

2. VB mail merge executable on the web

3. Error running Fortran executable from VB5

4. Running Fortran Executable

5. how to call VB 6 executable from VB.Net application

6. VB Executable to VB Form

7. Run a VB executable from Outlook VBA

8. VB executable

9. Can't run VB.Net executable?

10. Setting executable icon in VB.NET

11. .NET executables decompilers to VB.NET?

12. vb executable question

 

 
Powered by phpBB® Forum Software