Discussion:
Call in Visual Basic a Cygwin executable
(too old to reply)
arkkimede
2012-07-18 08:12:34 UTC
Permalink
Hi!
I'm a c programmer that usually produce console application.
To improve the look of my software, I'm studying Visual Basic.
The idea is implementing a Graphical User Interface with VB, this produces an input file and execute the cygwin code by mean the instruction
System.Diagnostic.Process.Start("nome_of_executable.exe")

I joint also that in the directory where is the executable there are all the
dll required by the cygwin executable to run. In fact, on windows, pushing on the executable it run correctly, but in VB it does not run.

Could you help me?
TIA
Deanna Earley
2012-07-18 09:09:45 UTC
Permalink
Post by arkkimede
Hi!
I'm a c programmer that usually produce console application.
To improve the look of my software, I'm studying Visual Basic.
The idea is implementing a Graphical User Interface with VB, this produces an input file and execute the cygwin code by mean the instruction
System.Diagnostic.Process.Start("nome_of_executable.exe")
I joint also that in the directory where is the executable there are all the
dll required by the cygwin executable to run. In fact, on windows, pushing on the executable it run correctly, but in VB it does not run.
It could be that your cygwin application is relying on the working path
being set to the executable/dll folder.

System.Diagnostics.ProcessStartInfo info = new
System.Diagnostics.ProcessStartInfo(@"c:\path\to\nome_of_executable.exe","parameters");
info.WorkingDirectory = @"c:\path\to\";
System.Diagnostics.Process.Start(info);
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
arkkimede
2012-07-18 09:21:56 UTC
Permalink
Hi!
I'm a c programmer that usually produce console application.
To improve the look of my software, I'm studying Visual Basic.
The idea is implementing a Graphical User Interface with VB, this produces an input file and execute the cygwin code by mean the instruction
System.Diagnostic.Process.Start("nome_of_executable.exe")
I joint also that in the directory where is the executable there are all the
dll required by the cygwin executable to run. In fact, on windows, pushing on the executable it run correctly, but in VB it does not run.
Could you help me?
TIA
Thank you for your kind answer.
I'm a newbie of Visual Basic and, may be, I need more information.
Writing _only_ the code that you have posted (on a button click event) in Visual Basic there is an error:
<<'info' is not declared. It may be inaccessible due to its protection level>>

It's necessary declare info before?
Tanks
arkkimede
2012-07-18 10:06:36 UTC
Permalink
I solved (following the suggestions of Deanna Earley).

For newbie like me I post the complete button click event:
Private Sub Button1_Click(........)
Dim info As New System.Diagnostics.ProcessStartInfo
info.FileName = "C:\path\nameExecutable.exe"
info.WorkingDirectory ="c:\path\"
System.Diagnostics.Process.Start(info)
End Sub

bye.
Deanna Earley
2012-07-18 10:28:17 UTC
Permalink
Post by arkkimede
I solved (following the suggestions of Deanna Earley).
Private Sub Button1_Click(........)
Dim info As New System.Diagnostics.ProcessStartInfo
info.FileName = "C:\path\nameExecutable.exe"
info.WorkingDirectory ="c:\path\"
System.Diagnostics.Process.Start(info)
End Sub
That's it. Sorry, I forgot my code was C# :)
--
Deanna Earley (***@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
Farnsworth
2012-07-18 10:33:00 UTC
Permalink
Post by arkkimede
Hi!
I'm a c programmer that usually produce console application.
To improve the look of my software, I'm studying Visual Basic.
The idea is implementing a Graphical User Interface with VB, this produces
an input file and execute the cygwin code by mean the instruction
System.Diagnostic.Process.Start("nome_of_executable.exe")
I joint also that in the directory where is the executable there are all the
dll required by the cygwin executable to run. In fact, on windows, pushing
on the executable it run correctly, but in VB it does not run.
Could you help me?
TIA
For future reference, this group usually deals with VB6 and lower, and most
of the people who hang in here use it. For VB.Net, use this forum:

http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic/

The two languages have major differences and there is no reliable automated
way to upgrade between the two. Upgrading often requires a rewrite. VB6 is
the last version that is not reliant on the .Net runtime. VB6 runtime is
included in Windows 2000 through Windows 8, so pretty much you need just to
distribute the EXE, however it was released on 1998, so perhaps you may want
to stick with C.

Also, VB.Net/C# require the .Net library, which can take a long time to
update as it's several hundred MB. This may or may not be important to you.
Why not stick with C and use Qt or GTK+? Both are multiplatform and have
small runtime:

http://en.wikipedia.org/wiki/Qt_%28framework%29
http://en.wikipedia.org/wiki/GTK%2B
arkkimede
2012-07-18 11:45:47 UTC
Permalink
Post by Farnsworth
For future reference, this group usually deals with VB6 and lower, and most
http://social.msdn.microsoft.com/Forums/en-US/category/visualbasic/
Sorry! I'm a newbie and I didn't know the difference between the two languages.
In any case tank you for this information.
Post by Farnsworth
Why not stick with C and use Qt or GTK+? Both are multiplatform and have
http://en.wikipedia.org/wiki/Qt_%28framework%29
http://en.wikipedia.org/wiki/GTK%2B
I explored these languages and VB seems to me the easier.
Usually every language, after the classical application "Hello, World", become complex and it is hard to find examples that introduce, step by step, all the language elements.
Thank you.
Farnsworth
2012-07-18 14:56:56 UTC
Permalink
Post by arkkimede
Post by Farnsworth
Why not stick with C and use Qt or GTK+? Both are multiplatform and have
http://en.wikipedia.org/wiki/Qt_%28framework%29
http://en.wikipedia.org/wiki/GTK%2B
I explored these languages and VB seems to me the easier.
Usually every language, after the classical application "Hello, World",
become complex and it is hard to find examples that introduce, step by
step, all the language elements.
Here is another Basic variant I am considering, which costs 79 Euro(about
$104 USD), so it's not expensive.

http://en.wikipedia.org/wiki/PureBasic
http://www.purebasic.com/

I develop mostly shareware, and so it's important to me to have minimum
dependency.
Auric__
2012-07-18 19:45:50 UTC
Permalink
Post by Farnsworth
Post by arkkimede
Post by Farnsworth
Why not stick with C and use Qt or GTK+? Both are multiplatform and have
http://en.wikipedia.org/wiki/Qt_%28framework%29
http://en.wikipedia.org/wiki/GTK%2B
I explored these languages and VB seems to me the easier.
Usually every language, after the classical application "Hello, World",
become complex and it is hard to find examples that introduce, step by
step, all the language elements.
Here is another Basic variant I am considering, which costs 79 Euro(about
$104 USD), so it's not expensive.
http://en.wikipedia.org/wiki/PureBasic
http://www.purebasic.com/
I develop mostly shareware, and so it's important to me to have minimum
dependency.
I suggest FreeBASIC:
http://www.freebasic.net/

Completely free and open source. Largely based on QBasic. GUI via Win32 API
(and probably also standard resource scripts, but I've never tried),
wxWindows, and GTK; curses, Allegro, and the usual MS BASIC stuff (PRINT,
simple graphics, etc.) for console stuff. Supports Windows, Linux, and DOS.
(Theoretically, FreeBSD and the XBOX, too, but I've never tried either.)

Alternately, if you're after easy window design, you might want to look into
Real Studio:
http://www.realsoftware.com/realstudio/

Not free (starts at US$99, up to US$995), not open source, and not terribly
similar to MS BASIC, but IMO the easiest GUI design outside of MS's products,
and no dependancy on the .Net framework. Supports Windows, Linux, and Mac OS
X. (Older versions support pre-X Mac OS; I use a version from 2005.)

Most of my work is currently done in FreeBASIC, but REALbasic (an older
version of Real Studio) is what I use for cross-platform GUI development.
--
Las Vegas is a three-ring circus with a hangover.
arkkimede
2012-07-19 10:09:27 UTC
Permalink
On Wednesday, July 18, 2012 9:45:50 PM UTC+2, Auric__ wrote:

Many tanks to Auric and Farnsworth for suggestions

Loading...