Sunday, August 2, 2009

C++ programming help?

I want to know how programs made using Dev's Bloodshed compiler can be made to work in windows. All of them open in MS-DOS. Can you tell me how to convert them to windows programs, so that they don't open in MS-DOS.10 pts. if ur method works. :-)

C++ programming help?
First, you need to realize that because you pick a different type of project in the new project dialog, the IDE / compiler isn't going to translate a console source file into a Win32 or Win32s API program. To see a bit of what is needed, try the URL below for a good, short tutorial on Win32 API programming. And by the way, while you can write the logical controls or event engine in C++ and have this work, the Win32 and Win32s APIs are actually written in C. This means you'll see some deviation between the code style, so expect it.
Reply:Nothing concerning C++ and your compiler.


There is a difference between *console* applications and GUI applications.


First are what you call "MS-DOS". If your app has as an entry point "main" function, in Windows it will be console app. (It has entry point, IIRC, crtMainStartup).


Second starts with WinMain() instead of main().


You need to read one of the first Charles Petzold books on Windows programming.
Reply:That is console, not necessarily MS-DOS, Microsoft would like you to think console programs are DOS types and hence old but that is not accurate, JDK tools (now Java SDK) work in consoles among other programs.





Main() and WinMain() is probably a Microsoft-specific distinction, in all other development platforms I can see there is no such distinction needed. A program is given a console access to begin with and when it is programmed to load and use GUI library it turns into a visual program with buttons and scrollbars and window and everything.





Another important point: you can not just reprogram that Bloodshed compiler to use those GUI widgets itself. Or the other way around, turning a GUI program into console program. That goes to any ready-made software package.


No comments:

Post a Comment