Link to home
Start Free TrialLog in
Avatar of Cristi_E
Cristi_EFlag for Romania

asked on

System.Diagnostics.Process.Start() problem

Hello,
   I'm developing a Windows Mobile application in VB.Net 2005. I need to run the "System.Diagnostics.Process.Start() " to launch another application on the Pocket-PC.
How should i pass the parameters to launch the respective application?
I have a string variable (strPath) that contains the full path to the application.
If i try something like "System.Diagnostics.Process.Start(strPath)" i am noticed that the "Value of type 'String' cannot be converted to 'System.Diagnostics.ProcessStartInfo'"
Avatar of Mikal613
Mikal613
Flag of United States of America image

Avatar of Cristi_E

ASKER

I would like to use "System.Diagnostics.Process.Start() " in this case.... not "CreateProcess and C#".
I just need to know how to pass the parameters in order to launch the application that i want to .
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Dim startInfo As New ProcessStartInfo("YourApp") ... i get the following error:
Error      1      Overload resolution failed because no accessible 'New' accepts this number of arguments.
what type of device are you targeting?  Pocket PC 200X??
        System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
            psi.FileName = "/Windows/explore.txt";
            System.Diagnostics.Process.Start(psi);
Project type:  Visual Basic > Smart Device >  Windows Mobile 5.0 Pocket PC > Device Application.

Should i change the type of project to: Visual Basic > Smart Device > Pocket PC 2003 ?
no no 5.0 is perfect
Finally, based on what you send to me,  i managed to fulfill with this code:

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim appPath As String = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
        Dim startInfo As New ProcessStartInfo
        '
        startInfo.FileName = appPath & "\SampleApp.cab"
        System.Diagnostics.Process.Start(startInfo)
    End Sub

Thanks!