Main Page | Report Page

 

  .NET DotNet Forum Index » VB.NET Forum (Visual Basic .NET) » Visual Basic and WPF...

Author Message
Ricardo Furtado...
Posted: Thu Dec 10, 2009 3:42 pm
 
I have a solution with a visual basic 2008 project and a WPF implemented with
C# and i need to call the wpf project from inside the vb project, in run
mode. Is it possible? how?
Do i need to call the Shell method? isn't there a better way, so i don't
need to identify the place where the wpf .exe file is, since their in the
same project?

My thanks in advanced
 
Family Tree Mike...
Posted: Thu Dec 10, 2009 6:28 pm
 
On 12/10/2009 3:42 PM, Ricardo Furtado wrote:
Quote:
I have a solution with a visual basic 2008 project and a WPF implemented with
C# and i need to call the wpf project from inside the vb project, in run
mode. Is it possible? how?
Do i need to call the Shell method? isn't there a better way, so i don't
need to identify the place where the wpf .exe file is, since their in the
same project?

My thanks in advanced

The default location to launch an application would be the same folder.
Just copy the WPF exe to the same folder as your vb application. I
would use System.Diagnostics.Process, rather than Shell() though.

You might also consider adding a reference to your WPF project in your
vb project. Yes, you can add a reference to an executable project. Now
you can instantiate your executable's main class.

--
Mike
 
Ricardo Furtado...
Posted: Fri Dec 11, 2009 9:22 am
 
Awsome. Thanks a lot for your help

"Family Tree Mike" wrote:

Quote:
On 12/10/2009 3:42 PM, Ricardo Furtado wrote:
I have a solution with a visual basic 2008 project and a WPF implemented with
C# and i need to call the wpf project from inside the vb project, in run
mode. Is it possible? how?
Do i need to call the Shell method? isn't there a better way, so i don't
need to identify the place where the wpf .exe file is, since their in the
same project?

My thanks in advanced

The default location to launch an application would be the same folder.
Just copy the WPF exe to the same folder as your vb application. I
would use System.Diagnostics.Process, rather than Shell() though.

You might also consider adding a reference to your WPF project in your
vb project. Yes, you can add a reference to an executable project. Now
you can instantiate your executable's main class.

--
Mike
.

 
Herfried K. Wagner [MVP]...
Posted: Fri Dec 11, 2009 12:57 pm
 
Ricardo Furtado schrieb:
Quote:
I have a solution with a visual basic 2008 project and a WPF implemented with
C# and i need to call the wpf project from inside the vb project, in run
mode. Is it possible? how?
Do i need to call the Shell method? isn't there a better way, so i don't
need to identify the place where the wpf .exe file is, since their in the
same project?

You may want to set a reference to the C# project from within the VB
project and directly access the classes exported by the C# assembly.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sat May 28, 2016 1:06 pm