469,336 Members | 6,233 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

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 1377

"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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Omer van Kloeten | last post: by
6 posts views Thread by Nafai | last post: by
5 posts views Thread by Carmine Cairo | last post: by
39 posts views Thread by Martin Jørgensen | last post: by
5 posts views Thread by Tio | last post: by
3 posts views Thread by Rene | last post: by
16 posts views Thread by =?iso-8859-1?q?|-|e|=5F|=5F_B0=DD?= | last post: by
1 post views Thread by prasath03 | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.