473,663 Members | 2,694 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Window Forms Application without Command Prompt Window

Hi everybody.

I've got a simple but bothering problem.
I've just written a little application in C#.
I've got a set of business logic classes and a window forms GUI released
as a set of libraries (dll).
So the GUI class extends the System.Windows. Forms.Form base class
and anything else (no Main method).

From the class in which I've written the Main method and that's included
in another "project" and namespace and it's compiled as an "exe" project
I do some "configurat ion" activities (read from files etc) and then
I create an instance of the GUI class with:
Application.Run (new GUIForm());

Everything works very well but I can't close the Command Prompt (DOS)
Window without closing the GUI as well!

As I read in the documentation it seems the only one way not to have
the DOS window opened is to implement a Main method in the GUI class
in which invoking the Application.Run static method.
But my original idea was to package the presentation logic class in a DLL
and call them by another executable class - as I explained.

Do you think there's a solution?

Thaks to everything who'll pay attention for my problem.
Sorry for the "English".

Luca Paganelli.
Nov 15 '05 #1
2 2617
"Luca Paganelli" <lu*******@TOGL ILOlibero.it> wrote in message
news:ZF******** ***********@tor nado.fastwebnet .it...
From the class in which I've written the Main method and that's included
in another "project" and namespace and it's compiled as an "exe" project
I do some "configurat ion" activities (read from files etc) and then
I create an instance of the GUI class with:
Application.Run (new GUIForm());

Everything works very well but I can't close the Command Prompt (DOS)
Window without closing the GUI as well!

Hi Luca,

It sounds like you are compiling your application as a Console Application.
Fixing it depends on how you are compiling your program.

If you are using VS.NET, right-click on the project name in Solution
Explorer and select Properties. Under Common Properties, General the
property grid has an item called Output Type. Make sure that is set to
"Windows Application".

If you're using the command line or a tool that invokes the command line, be
aware the the default is for a Console Application. So, you will have to
change the /target option to a Windows Application, like this:

csc /target:winexe /r:myLibrary.dll myProgram.cs

Joe
--
http://www.csharp-station.com
Nov 15 '05 #2
Thank you very much Joe.
I'm using C#Builder but I found the way to change the "output type" to
Windows Application.

I didn't know there were different "exe" types.
I'm just beginning to work with C#.NET.

Thanks a lot!
Luca Paganelli

Hi Luca,

It sounds like you are compiling your application as a Console Application. Fixing it depends on how you are compiling your program.

If you are using VS.NET, right-click on the project name in Solution
Explorer and select Properties. Under Common Properties, General the
property grid has an item called Output Type. Make sure that is set to
"Windows Application".

If you're using the command line or a tool that invokes the command line, be aware the the default is for a Console Application. So, you will have to
change the /target option to a Windows Application, like this:

csc /target:winexe /r:myLibrary.dll myProgram.cs

Joe
--
http://www.csharp-station.com



Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
22068
by: John H. | last post by:
Hello I have some trouble in closing a window, Here is the problem: I develop a asp.net website use client side valiation <asp:CustomValidator id="CustomValidator1" ControlToValidate="Text1" ClientValidationFunction="BasicSearchValidation" OnServerValidate="ServerValidation"
14
7949
by: Nigel Mercier ® | last post by:
I'm just starting to learn JavaScript, so far I like it! I want to add some JS to my Ebay listings, to manually open a pop-up window. It works OK, but the JS gets rejected by Ebay. If I can't use JS in my listing, is there a way of using JS to resize a current window, and remove the toolbars etc, so it looks like a pop-up? --
0
834
by: Laura Zeafla via .NET 247 | last post by:
I used the .NET forms application wizard. From the form youclick a button and it calls a C++ function through its dll. This function is supposed to pop-up a command prompt window. Something about using this forms application wizard prevents thewindow from opening. The program otherwise runs correctly. Inoticed that the wizard gave me a main with the notation: int APIENTRY main(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR ...
0
1513
by: Laura Zeafla via .NET 247 | last post by:
I have an application I wrote using the Windows Form Application(.NET) wizard. Pressing a button calls a function in a dllwritten in Visual C++. This function is supposed to cause acommand prompt window to open and some information to scroll by.My problem is that using the Windows Form Application wizardprevents the command prompt window from opening. Otherwise thedll functions correctly. I noticed that the wizard used a mainin the form:...
2
2759
by: Mustaq | last post by:
Hi, I have an application in VB.NET which runs from command prompt, I need output message in the same command prompt window, Example D:\Mustaq\ORC\Orc 3.7\Insertor\Insertor\bin>insertor.exe I need message to be printed "Completed Sucessfully" or Failed in command prompt window
6
3232
by: Mark Allison | last post by:
Hi, I have an application that I want to be to run in Console mode and GUI mode. If no params are entered, I want the GUI fired up, if params are entered, then go into console mode. I believe I have all the code set up to do this, however when I issue a Console.WriteLine instruction, nothing gets written to the console. In fact, the command prompt comes back before the program has finished executing. What do I need to do?
0
1029
by: January Smith | last post by:
When I run the code below after creating an Empty .Net type project and adding an Empty C++ file it always opens a command window before displaying the form. If I write a similar VB application by starting an Empty Project and adding a Code File into which I type my code, it runs without starting a command window. Is there a project property that specifies that the command window is not necessary? If I create the C++ project as a...
7
12357
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
2
1370
by: risberg83 | last post by:
Hi I want to create a program that starts some kind of command window. The program should contain some functions and the user should be able to call these functions trough the command window. Eg. If I have a sub called hallo() that prints "hallo" in the command window, I want to be able to call it from the command window with some command like "hello()". Is this possible to do, and if it is what is the easiest way to do it?
0
8436
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8771
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2000
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.