March 3rd, 2003, 12:37 AM
Coverting DOS programs to Windows
Since my Python application isn't working on other computers that don't have Python installed, I was thinking about starting my program in DOS (since I know C++ already) and converting it to Windows after I learn Win32. Is this a good idea? Is it easy to convert? And when I say "easy," I'm not looking or expecting a one-click converter, but I also don't want to start with DOS if it will be difficult to convert later on.
March 3rd, 2003, 01:35 AM
Just throwing these thoughts out:
"DOS programs" are developed under Win32 as "console applications". Most all the resources of Win32 (if not all -- I haven't tried pushing the limits yet) are available to a console application, including multithreading and DLLs. But you would not be able to run it on a Win16 machine (eg, Windows 3.1 or a DOS machine).
The biggest difference between a console app and a Windows app is the user interface. The other main diffence is that a Windows app makes use to the Windows messaging system, which dictates the overall structure of the program. Some applications just work better as a console app and others as a Windows app. You have to decide how your program would work better.
By the same token, converting a console app to Windows would mainly mean changing the overall structure of the program, though most of the worker functions should be fairly easy to port over. For that matter, the real data/number crunching part of the program could be considered its "engine" and split off into a DLL, which then can be used equally well by either a console or a Windows app.
The other more obvious aspect of that conversion would be in changing from a console's "teletype" text interface to a GUI with menus and dialogs. Again, some applications lend themselves more readily to console apps and others to Windows. For example, I wrote a console app to test NTP and timserver servers; its command-line interface hat works just fine, but a GUI interface could be cumbersome.
In short, I would think that you should be able to port a lot of your work from the console app to the Windows app, just not much of the user interface.
March 3rd, 2003, 03:18 AM
I am developing a weather forecasting program. This is an at home project that I'm doing just to see if I can extend my programming expertise to desktop applications. Yes, this is the same program I've been talking about in other posts.
After posting this question, I thought making a console-based program wouldn't be an option since the program (text or GUI-based) needs to have internet capabilites (the forecasts are downloaded from a website). It's nice to know that most of the Win32 functions are available to console apps as well. Are all console projects automatically Win32-based, or does it depend on the compiler you're using?
You mentioned putting the heart of my app. into an engine with a dll file. Where would I find information on how to do that? I've never messed with dll's, nor have I seen any books on them. I'm pretty big on grouping like functions, classes, and commands together to make updating easier, so the dll thing sounds interesting. Also, I haven't seen any tutorials or books on making complex console apps. Can you recommend any? Thanks!
March 3rd, 2003, 04:23 AM
"You mentioned putting the heart of my app. into an engine with a dll file. Where would I find information on how to do that?"
Ivor Horton's Beginning Visual C++ has a short chapter entitled "Writing your own DLLs".
March 3rd, 2003, 05:12 AM
Oh yes, I remember seeing that.