473,513 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with the compiler?

Hi NG
I've written this little test-program. Why does it open a console/cmd
shell and how to prevent this? Is it a problem with my compiler (Dev-C++
4.9.8.0 from Source-Forge)?

-------------CODE--------------

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR
szCmdLine, int iCmdShow)
{
while (true){
// do nothing
}
return 0;
}

-------------------------------
Jul 22 '05 #1
5 1560

"Jan Kassens" <Ja*********@web.de> wrote in message
news:c7*************@news.t-online.com...
Hi NG
I've written this little test-program. Why does it open a console/cmd
shell and how to prevent this? Is it a problem with my compiler (Dev-C++
4.9.8.0 from Source-Forge)?

-------------CODE--------------

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR
szCmdLine, int iCmdShow)
{
while (true){
// do nothing
}
return 0;
}


I think you'll find the following opens a console.

int main()
{
while (true)
{
}
}

john
Jul 22 '05 #2
John Harrison wrote:
I think you'll find the following opens a console.


Sorry u misunderstand me. I don't want to open the console. I'll have a
program without a console and without any window.

PS: i'm not a native English-speaker ;)
Jul 22 '05 #3
Jan Kassens wrote:

Hi NG
I've written this little test-program. Why does it open a console/cmd
shell and how to prevent this? Is it a problem with my compiler (Dev-C++
4.9.8.0 from Source-Forge)?

-------------CODE--------------

#include <windows.h>

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR
szCmdLine, int iCmdShow)
{
while (true){
// do nothing
}
return 0;
}

-------------------------------


It has to do w/ the subsystem type for the generated executable. For Windows
apps, there are several types (such as console, windows, posix).

You will need to consult your compiler documentation to see how to change the
subsystem type. Follow-ups should be directed to the appropriate Windows
programmer newsgroup(s).
Jul 22 '05 #4
Julie wrote:
subsystem type. Follow-ups should be directed to the appropriate Windows
programmer newsgroup(s).


Thank you.
i'll do it.
Jul 22 '05 #5
Jan Kassens wrote:
John Harrison wrote:
I think you'll find the following opens a console.

Sorry u misunderstand me. I don't want to open the console. I'll have a
program without a console and without any window.

PS: i'm not a native English-speaker ;)


I don't know of a way to do that. You can have a window and hide it,
but internally, it either runs os a Windows program or as a console program.

I would love to be wrong about this, though.

Jorge L.
Jul 22 '05 #6

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

Similar topics

3
3119
by: Omer van Kloeten | last post by:
The Top Level Design: The class Base is a factory class with a twist. It uses the Assembly/Type classes to extract all types that inherit from it and add them to the list of types that inherit...
6
2024
by: Nafai | last post by:
Hello. I want to do something like this: class A { // It's virtual protected: float* data; int n; public: A(int a); virtual float* createData(); //...
6
2305
by: Alex | last post by:
I've a problem with following simple code (not really usefull): //--------------------------------------------------------------------------- #pragma hdrstop #include "stdio.h" #include...
5
3301
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
102
5574
by: Skybuck Flying | last post by:
Sometime ago on the comp.lang.c, I saw a teacher's post asking why C compilers produce so many error messages as soon as a closing bracket is missing. The response was simply because the compiler...
39
19560
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1)...
5
2208
by: Tio | last post by:
I have project in MFC(vc++) . There are files and classes: classes:dialog1,dialog2,aaa,bbb ---------------------- main.cpp --------------------- #include "mainfrm.h" #include "dialog1.h"...
3
3430
by: Rene | last post by:
Hello to all! For a long time I have been "fighting" a problem compiling an OpenGL program which uses GLUT. First I have put a question in a Watcom group (I want to use this compiler) to which I...
16
3827
by: =?iso-8859-1?q?|-|e|=5F|=5F_B0=DD?= | last post by:
hi all! I got a problem. I declared a SOCKET var in my C program but when i compiled the program it displayed like *--------------------------------------------------------------* *'SOCKET':...
1
2075
by: prasath03 | last post by:
Hi, I am struggling with the following problem. Can somebody pls help me?. I am developing a wesbite for user can edit their files only, so i am going to develop a page for a Tree Structure in...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7101
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...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5686
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,...
1
5089
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
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...
0
3234
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...
0
1596
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.