![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Nov 2006
Posts: 3
Rep Power: 0
![]() |
Hi, I've taken an open source small http server written in 'C' and added: port scanning (for finding an available port to run on), functionality for it to kick open a browser and terminate the server after the browser is closed.
The problem: The executable opens a console window when executed. My attempts:
At this point, I don't know what direction I should be heading. I am not very familiar with Windows programming at all. My goal is to run the executable so that no console window appears, ever. If I have not supplied enough information, please ask me. I am trying to provide everything that is pertinent. I have been using the microsoft "cl" complier and a text editor to develop the software. I've also been searching several ideas as to why I am having so much trouble. Perhaps:
Thanks in advance for any and all help. |
|
|
|
|
|
#2 |
|
Programmer
|
I think there's a code to AllocConsole() that you can get rid of, can we see the code?
|
|
|
|
|
|
#3 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
Since you want a Windows app, I'd suggest you write it that way. Goats are expensive; I typically use a bottom-of-the-line chicken.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#4 |
|
Professional Programmer
|
You can also take a gander at this: http://www.codeproject.com/win32/runsilent.asp
A quick Google search pulled that up. It might be a bit more effective to write the program as a Windows application, as DaWei said.
__________________
The world's first athletic computer geek! The home of PrProgramsStudios How not to post a question: <-- Please don't reply |
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Apr 2005
Posts: 1,827
Rep Power: 5
![]() |
Here is a method that does not require you to modify the existing source code in any manner. But only if you are willing to spend 3 minutes to download and install Dev-C++. It compiles C code as well, don't worry.
- Start a new "Console Application" project. - Discard the automatically generated template code (you do not need this). - Select from the drop menu: "Project -> Project Options". - Click the "Compiler" tab. - Choose "Linker" from the list on the left. - Set "Do not create a console window" to "Yes". |
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You can also put that option in the makefile with gcc (as used in Dev-Cpp), but you might not want to get used to proprietary or compiler-specific thangys.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Nov 2006
Posts: 3
Rep Power: 0
![]() |
the code
Thanks for the help, but I'm still lost. Using the MinGW compiler supplied with Dev-C++, yields many errors. I've posted the code here:
http://www.auburn.edu/~allenbb/files/dhttpd.c |
|
|
|
|
|
#8 |
|
Programmer
|
Which errors?
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Manipulating the console using Windows API | rup | C++ | 2 | Nov 17th, 2006 1:04 PM |
| The Black Art of Video Game Console Design | lostcauz | Book Reviews | 0 | Apr 26th, 2006 7:31 PM |
| Tutorials for making a P2P program? | Palladio | C++ | 3 | Nov 26th, 2005 3:51 AM |
| console output | matko | C++ | 10 | Sep 26th, 2005 2:14 PM |
| Making a Note Adder/ Editor/ Deleter/ Viewer thingy | brokenhope | C++ | 19 | Apr 29th, 2005 1:30 AM |