Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ Python VB.NET
hi every body
i wanna run or compire c++ or python code in mine vb.net project
can i do this??
any source code ??
any idea??any component???
any Trick??
Posted 24-Aug-12 19:09pm
rpm3d669
Comments
Sergey Alexandrovich Kryukov at 25-Aug-12 1:32am
   
This is a pretty big question; a lot of things is involved. But not to hard to implement; it just needs some time. So, first, would you explain the goal of it? Do you want to create something like a small Visual Studio? Or something else? What?
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

First of all, you can execute any external application using one of System.Diagnostics.Process.Start methods:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx[^].
 
Pay attention that you can redirect output of your external process (a compiler, C++ or Python code, compiled application, etc.) to some stream and use it in your parent process. To do so, you will need to redirect StandardOutput and StandardError. Please see:
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standardoutput.aspx[^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standarderror.aspx[^].
 
Both MSDN help article referenced above contain some redirection code samples.
 
If you really mean not C++, but C++/CLI, you can dynamically compile and load the .NET assembly in your host application. This is a pretty complex problem if you need to make such code reloadable, because there is no way to unload an assembly, you you would need to create and unload separate Application Domains and worth through the Application Domain boundary with IPC. You can find further detail in my past answers:
Create WPF Application that uses Reloadable Plugins...[^],
AppDomain refuses to load an assembly[^],
code generating using CodeDom[^],
Create WPF Application that uses Reloadable Plugins...[^],
Dynamically Load User Controls[^],
C# Reflection InvokeMember on existing instance[^].
 
As to the Python, you also can think about using Python for .NET. Such thing does exist, called IronPython:
http://en.wikipedia.org/wiki/IronPython[^],
http://ironpython.net/[^].
 
All the options I mentioned may or may not be applicable. I don't know you goals, that's why. Next time, please start asking your question with explanation of your ultimate goals.
 
—SA
  Permalink  
Comments
rpm3d at 25-Aug-12 1:58am
   
hi Sergey ...how are you??first i tried send comment on your website but i couldn't maybe have problem...LOL
and about it not exactly small Visual Studio...but i think about it and this is my future project.....
so now
i am working on a project in this i need to some script of python and some source code of c++...and i should to use of them mean when is run i copmile them and run...so
what is your idea....or others idea..??
Sergey Alexandrovich Kryukov at 25-Aug-12 2:12am
   
Many people addressed to me via my "Contact me" page on the Web site without problems...
Why other idea? What I've written in my answer is applicable.
--SA
Espen Harlinn at 25-Aug-12 8:14am
   
Nice reply :-D
Mika Wendelius at 25-Aug-12 10:29am
   
Good answer :)
Sergey Alexandrovich Kryukov at 5-Sep-12 3:30am
   
Thank you, Mika.
--SA
Sergey Alexandrovich Kryukov at 5-Sep-12 3:30am
   
Thank you, Espen.
--SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

hi Sergey ...how are you??first i tried send comment on your website but i couldn't maybe have problem...LOL
and about it not exactly small Visual Studio...but i think about it and this is my future project.....
so now
i am working on a project in this i need to some script of python and some source code of c++...and i should to use of them mean when is run i copmile them and run...so
what is your idea....or others idea..??
Smile | :)
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Have a look at SharpDevelop[^] - it even includes a c# to vb converter.
 
SharpDevelop also supports IronPython - so there you have all you're asking for Big Grin | :-D
 
Best regards
Espen Harlinn
  Permalink  
Comments
rpm3d at 25-Aug-12 8:21am
   
damn it thank you...very nice
Mika Wendelius at 25-Aug-12 10:30am
   
That's a good link!
Espen Harlinn at 25-Aug-12 16:52pm
   
Thank you, Mika :-D

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 192
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,077
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 25 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100