Tuesday, September 29, 2009

C & C++ in Vista with DosBox


**You can run dos box in vista or XP to take screen shots of Graphic Programs. If you want to use Xp and TCC only(without using dos box) and still want to take screenshots , read carefully the graphic modes. There are graphic modes which makes the screen run in minimized mode while running program. And you can take screen shot. By default if you dont give any value the program runs in maximized mode and you can't take the screenshots. Search BGI modes**
To run c or c++ or any other 16 bit program in Vista , follow these steps
Step1:
Download DOSBOX. 3 links are given use any one. If one fails other is up for you

Link1: http://www.ziddu.com/download/6698045/DOSBox0.73-win32-installer.zip.html

Link2: http://www.easy-share.com/1907950000/DOSBox0.73-win32-installer.zip

Link3: http://www.filefactory.com/file/a0c9d83/n/DOSBox0_73-win32-installer_zip

it is 1.37 MB file

Step2:
Install Dos box

Step3:Run Dosbox. This screen will pop.
Click on images to get them enlarged



Step4 Now you will see Z: drive as prompt. But there is no Z: drive in your system! So its all virtual. To Run C COMPILER you have to mount a folder. The following steps will tell you how to mount but before that make the folder to be mounted ready. How?

You can mount only 1 folder. But if you open Tcc folder there are sub-directories in tc folder namely include and others.So:

*Make a new folder in your c: drive and name it newtc
**Copy all the files from tcc folder to your newly made 'newtc' folder. don't copy any folder from tcc folder
***now the folders in tcc folder , which were not copied in step**. Open all folders one by one and copy their respective files to your 'newtc' folder.

Step5
Go to dosbox. type as it is mount j c:\newtc change your command if your folder name is different or drive is different or both. Dosbox will give successful message . then type j: and then tc


Step6
Since you changed the directory structure of tc folder , when you will open tc make the changes. Go to options of c/c++ compiler then Directories then clear every text(path) you see. delete it. let ir be empty in each and every box.

You are done!
Warning:
1: Pressing alt + f9 will close dos box , so use mouse to run your program. Or press alt+R, then hit return key
2: since you changed the path of directories , if you want to use BGI , your path will be simply "C:\\"
3.When you will save program , all your programs will be saved in "newtc" folder.
4.You can easily take screenshots of the grapical programs you run in dosbox.

Do leave comments!
Regards