|
I need to shell out from a VB6 executable to an existing .Net executable which can accept two optional parameters. When testing and forcing the two optional parameters by hard-coding the optional values in the .Net executable, it works fine. When I try and shell out from the VB6 program, the parameters only show up as empty strings (I have a messagebox coming up in the .Net executable that tells me the incoming input parameters).
Here is my .Net code:
Public Class frmSignon Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New(Optional ByVal strMenuItem As String = "", Optional ByVal strDataSource As String = "") MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub . . . Private strAutomatedMenuItem As String = strMenuItem Private strIncomingCVDataSource As String = strDataSource . . .
Private Sub frmSignon_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load . . . MessageBox.Show(strAutomatedMenuItem, "frmsignon - menu item") MessageBox.Show(strIncomingCVDataSource, "frmsignon - data source") . . . End Sub
The following is the script that I'm executing from the "Run" command to test with: C:\Development\FiberNetReporting\bin\FiberNetReporting.exe A CVCN
The "A" above is the first parameter and the "CVCN" value above is the second parameter. When I hard code these values into the following:
Public Sub New(Optional ByVal strMenuItem As String = "A", Optional ByVal strDataSource As String = "CVCN"), it works fine.
However, I need to leave them as a default empty string because they should not be hard-coded.
Does anybody know how I can successfully pass in parameters from one executable to another? |