Running a new process in vb.net 2003 application help???

tentavarious
tentavarious used Ask the Experts™
on
Experts, I am not real sure what is happening when I try to start a new process within my vb.net 2003 app.  What I have is vb.net2003 app that runs an external vb6 application called Report.exe.  The developer left and we are having some problems can someone break down the process and tell me exactly what is going on with the lines of code below:

  Dim P As New Process
        P.StartInfo.FileName = "Report.exe "
        P.StartInfo.UseShellExecute = False
        P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
        P.StartInfo.CreateNoWindow = True
        P.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
        P.StartInfo.WorkingDirectory = System.IO.Directory.GetCurrentDirectory
       P.Start()

This process is suppose to make a call to our oracle database and build pdf file, it doesn't seem to be working so I am checking everything.  
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
All that this code does is launch an executable.  Everything looks ok, except there is a duplicate line that does nothing.  I pasted this into a vb.net app and changed "Report.exe" to "notepad.exe" and it launced the program.
Can you run report.exe from the OS?  It may not have a GUI.
Fernando SotoRetired
Distinguished Expert 2017

Commented:
If the above code does not crash then the system was able to find and execute the program Report.exe. But seeming that did not happen I suspect that the problem is somewhere else. I would attempt to run the Report.exe application from the OS as Bill-Hanson has suggested as a good place to start.

Author

Commented:
Ok I was able to find the source files but my vb6 is rusty plus I have never used an Oracle Reporting Control, how can I get my vb.net app to run this debug version that way I can step through the code?
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Author

Commented:
I forgot these lines of code, I need to pass some arguments to the Report.exe, how could I do this without having to run my .net app.  I can get the variables below I just want to test the Report.exe and pass the arguments.
if para <> ""
    P.StartInfo.Arguments = ReportName & "," & OutputName & "," & Parm
            Parm = ""
        Else
          P.StartInfo.Arguments = ReportName & "," & OutputName
end if
Fernando SotoRetired
Distinguished Expert 2017

Commented:
Well I do not think you will be able to debug the VB 6 code through the VB .Net debugger because the way the two store debug information. Seeming that all the VB .Net applications is doing is to tell the OS to execute the VB 6 code and that it why not just load the VB 6 program into the Visual Studio 6 IDE and debug it from there.
Retired
Distinguished Expert 2017
Commented:
To find out what parameters to send to the VB 6 code you can do the following:

Place a break point on this line of code in VB .Net application

if para <> ""

Then run the application. When the IDE hits the breakpoint check the values of ReportName, OutputName and Parm. Then run the VB 6 application from the command line and enter the follow:

Lets say that when you ran the VB .Net app you found the value of the above variables to be the following:

ReportName  =  MyReport
OutputName  =  MyOutputReport
Parm             =  123

then in the command line window type the following:

Report MyReport,MyOutputReport,123

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial