Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > Visual C++
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 21st, 2004, 12:14 PM
Registered User
 
Join Date: May 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default passing/getting arguments from ShellExecute

Hi Everyone,
                      I am calling an Visual Fortran exe file from VC++ using ShellExecute and passing some parameters with it. I want my Fortran program to retrieve the parameter. I am using GetArg to retrieve it but it only works when i pass the parameter from the command-line and not using VC++

Herez the test code:

VC++ part of the code

Code:
#include <iostream>
#include <windows.h>
#include <shellapi.h> 
int main(void)
{
 
 ShellExecute(NULL,"open","C:\\Sassi\\MAIN\\HOUSEEx.exe","pb1","", SW_SHOW );
 
 return 0;
}
Visual Fortran part of the code

 
Code:
use dflib
Code:
 CHARACTER  MODNAME*50,FINP*120,FOUT*120,FILE4N*100
      MODNAME = ''
      IST=0
      print*,'enter program HouseEX'
 print*, 'ist=',ist
 CALL GETARG (1, MODNAME)         
      IST = len(trim(MODNAME))
 open(10,file='abcd.dat')
 write(10,*) modname
 write(10,*) ist
 close(10)
 IF (IST.LT.1) THEN
           PRINT *,' ENTER INPUT FILE NAME '
           READ (*,22) FINP
           PRINT *,' ENTER OUTPUT FILE NAME '
           READ (*,22) FOUT
           PRINT *,' ENTER FILE4 NAME (INCLUDING FULL PATH)'
           READ (*,22) FILE4N
 Else
  Print *,' Argument received '
      ENDIF
22    FORMAT(A)
End
Any suggestion or help would be greatly appreciated.

---TaZ






Similar Threads
Thread Thread Starter Forum Replies Last Post
Declarative arguments passing between DetailsViews andremi Classic ASP Basics 1 May 10th, 2007 09:24 PM
Passing multiple arguments to function zarikiane XSLT 2 July 18th, 2006 09:35 AM
passing arguments to executables DaveG BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 May 30th, 2006 03:26 PM
Problem passing multiple arguments to php script method PHP How-To 0 February 8th, 2006 09:03 AM
Passing arguments to contructor of dynamically... jacob ASP.NET 1.0 and 1.1 Professional 3 December 2nd, 2005 02:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.