Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello all.

i am in a situation where i have an application through which i am calling another .exe for displyaing some Documents. the exe displaying documents is having Adobe activex controll hence it is under build X86. since my main application is bulit under Any Cpu mode (and i cant change it to X86) i cant make it call reportvewier application as dll.

My problem is report viewer has to act differtntly for different users. if i was calling a dll then i would built a constructor and would have passed some arguments while Instansing that class and my problem would have solved.
but here the senerio is i am hitting an exe to which i will not be able to pass arguments like wise in calling a dll.

is there any way to pass custom arguments to a exe like how we pass command line arguments while calling a process.????

any help will be appreciated..

thank u
Posted
Updated 14-Mar-15 0:56am
v2

1 solution

Yes - you pass it command line arguments! :laugh:
When you run an EXE from teh command line, you can pass what you need:
MyExe D:\Temp\MyFileToPrint.txt /P:EPSON_BX305

You can do the same when you use Process.Start to run an external EXE file:
C#
Process.Start("MyExe", @"D:\Temp\MyFileToPrint.txt /P:EPSON_BX305");

MSDN[^]
 
Share this answer
 
v2
Comments
vikaskallidantheyil 14-Mar-15 7:38am    
thank U :-)
OriginalGriff 14-Mar-15 7:43am    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900