13 Replies - 888 Views - Last Post: 23 April 2010 - 04:46 AM Rate Topic: -----

#1 elvir22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 05-March 09

Opening VB.net with a vb.net application

Posted 16 April 2010 - 09:02 AM

Hi,

Just need a lil help. I want to open a vb.net application with a vb.net application if that makes sense. Im designing a programme that allows the end user to open and have a go at doing a vb.net appliction with the application that im making.

Ive tried something like this:

        Try
            Dim p As New System.Diagnostics.Process
            p.StartInfo.FileName = "K:\Uni\Year 2\Visual Basic\Report\MSDN\Absolute Beginner's Series VB Lesson 1\01 VB Code\Lesson01\HelloWorld.exe"
            p.Start()
        Catch ex As Exception
            MsgBox("Error - " + ex.Message)
        End Try


But keep getting an error that it can't find the application even thought it is there. I think it might be the .exe that is wrong but im not sure want ending the VB.Net application uses

Is This A Good Question/Topic? 0
  • +

Replies To: Opening VB.net with a vb.net application

#2 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 637
  • Joined: 03-February 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 09:30 AM

More likely than not you are correct. You need to make sure that the ...\01 VB Code\Lesson01 folder contains the HelloWorld.exe. If it does not then either move it to there or expand your path to the location of the compiled exe, which is probably in the bin\debug or bin\release folders.
Was This Post Helpful? 0
  • +
  • -

#3 elvir22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 05-March 09

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 09:41 AM

Still no joy, even when i try other files in the debug folder etc. What i want it to do is open up the vb application and the end user to be able to modify and see the code, not just the finished programme.

Does vb use the .exe ending? or is it something else?
Was This Post Helpful? 0
  • +
  • -

#4 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 637
  • Joined: 03-February 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 09:44 AM

it's not the application you want to open, application implies an exe file. You want to be able to edit the code. In that case you would want to use the .sln file.
Was This Post Helpful? 1
  • +
  • -

#5 elvir22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 05-March 09

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 10:10 AM

Thanks for that. Knew thats what i was doing wrong but didnt know what ending the vb applications use.
Was This Post Helpful? 0
  • +
  • -

#6 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 637
  • Joined: 03-February 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 10:13 AM

Either .sln or in the case of VB could be .vbproj (C# .cproj) should open visual studio with the solution.
Was This Post Helpful? 0
  • +
  • -

#7 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 464
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 10:14 AM

just a point if i may stop using this
MsgBox("Error - " + ex.Message)

use "&"
MsgBox("Error - " & ex.Message)
because "A" + "B" may result to sum (65+66) not to "AB".

This post has been edited by NoBrain: 16 April 2010 - 10:15 AM

Was This Post Helpful? 0
  • +
  • -

#8 elvir22  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 05-March 09

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 10:37 AM

Thanks for that tip aswell. Im still learning
Was This Post Helpful? 0
  • +
  • -

#9 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 10:39 AM

Another tip would be, since it is Visual Basic .NET - start using MessageBox.Show() instead of MsgBox, which is deprecated.

Also, for complex strings, I would recommend using something like:

Dim message As String = String.Format("An error occured - {0}", errorMessage)

Was This Post Helpful? 0
  • +
  • -

#10 mXX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 14-April 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 11:24 AM

View PostCore, on 16 April 2010 - 09:39 AM, said:

Another tip would be, since it is Visual Basic .NET - start using MessageBox.Show() instead of MsgBox, which is deprecated.

Im also still learning vb.net and also using msgbox. Why is it better to use messagebox.show? isnt it the same result?

This post has been edited by mXX: 16 April 2010 - 11:25 AM

Was This Post Helpful? 0
  • +
  • -

#11 demausdauth  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 176
  • View blog
  • Posts: 637
  • Joined: 03-February 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 11:38 AM

It is similar but as Core stated it is deprecated -- meaning it will eventually disappear. Highly unlikely ;) , but the newer methods and functions give you better or more options. Also, you're learning the latest version of the language, why not use the version of a method/function that is more appropriate for the framework. -- granted when I reread this it really sounds more like opinion, take or leave it I guess :D .
Was This Post Helpful? 1
  • +
  • -

#12 mXX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 14-April 10

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 12:07 PM

View Postdemausdauth, on 16 April 2010 - 10:38 AM, said:

It is similar but as Core stated it is deprecated -- meaning it will eventually disappear. Highly unlikely ;) , but the newer methods and functions give you better or more options. Also, you're learning the latest version of the language, why not use the version of a method/function that is more appropriate for the framework. -- granted when I reread this it really sounds more like opinion, take or leave it I guess :D .

didnt know that whas the newer methode =)
Ill try for now on to use the newer methode :D
thx for the info
Was This Post Helpful? 0
  • +
  • -

#13 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: Opening VB.net with a vb.net application

Posted 16 April 2010 - 01:48 PM

One of the reasons for using MessageBox.Show() is outlined here:
http://www.gringod.c...messageboxshow/
Was This Post Helpful? 2
  • +
  • -

#14 jeremejazz  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 22
  • View blog
  • Posts: 48
  • Joined: 23-April 10

Re: Opening VB.net with a vb.net application

Posted 23 April 2010 - 04:46 AM

Thanks for that code of yours, it helped us on our project in school. I would like to help you in return.
As a solution to your problem, I suggest that you would make the separate application relative to your executable file so that
moving the whole project to another location whould not affect the path you specified.
Your file path should look like this.
.
.
p.StartInfo.FileName = "Your Program.exe" 	'your relative path, no need to include the drive location for portability
.
.

Just make sure that the program is located beside the program you are debugging.

You can do this by adding another project as a reference to your main project so that everytime you compile, the executable(of the other program) automatically
proceeds to the bin where they would reside as they are executed.
Posted Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1