![]() |
About importing your projects
I've made some console applications with Borland C++ Builder 4. Now when Microsoft releases the 2005 versions of Visual Studio or their individual languages I might decide to purchase that. My question is will I be able to import my existing projects made with C++ Builder into Microsoft's tool? Will Visual Studio or whatever language be able to open them and work with them?
|
If your Borland projects comply with the ANSI standard, then they should work with any ANSI-compatible compilers. However, if you use Borland-specific headers in your projects, you will have to find a replacement library for the appropriate functions, or use one that MSVS provides you. Things like conio.h and tv.h (among others, I'm sure) have been re-written to be used for non-Borland compilers. I am not sure of what libraries you used in your Borland projects.
|
Well the two that I've mostly used are:
#include <iostream> #include <conio> When you say conio has been re-written to be used by non-Borland compilers, do you mean conio has been re-written by Borland(since that header file I think is particular to Borland)? So like Borland C++ Builder version 6 has a conio header file that has been re-written in such a way that Visual Studio will be able to use it? Not sure what you mean. |
It seems that conio.h has only been ported (as far as I know) to MingWin (the compiler I use). As such, that wouldn't be too much help to you using MSVC's compiler :D
However, there is an alternative that might help you out: curses/ncurses/pdcurses. You can get the libraries at http://dickey.his.com/ncurses/ncurses.html (as well as a tutorial for it at http://web.cs.mun.ca/~rod/ncurses/ncurses.html ), or http://sourceforge.net/projects/pdcurses/ for pdcurses. They have much (if not all) of the functionality that conio.h has, and can (as far as I know) be used with MSVC. iostream is no problem. |
I know for a fact conio.h was available in Microsoft Visual C++ 6 - not sure about .NET, but it's probably still there.
|
Well I'm just a beginner trying to reacquaint myself with writing simple C++ programs so forgive me for asking but would I just download that ncurses file and install it and then when writing my C++ program in C++ Builder just write:
#include <iostream> #include <ncurses> And then later when or if I switch to Visual Studio that program will recognize the <ncurses> directive and successfully open and run my projects? I will ask on the Microsoft site concerning <conio> and see if .NET and/or Visual Studio 2005 recognizes it. Actually the only reason I had to use <conio> is to prevent the console program from closing so fast. I believe with Microsoft's compilers you don't have to worry about that cuz they put the line "Press any key to continue" at the end of your output to keep the console window open for you. |
They do. You can also use getchar(); which is included in stdio.h.
|
>>Actually the only reason I had to use <conio> is to prevent the console program from closing so fast. I believe with Microsoft's compilers you don't have to worry about that cuz they put the line "Press any key to continue" at the end of your output to keep the console window open for you.
That's probably the most common 'problem' with programs that people have when writing for the console. However, it's not even a problem -- the console just closes when the program's done. Instead of adding yet another function to the program, you could always just go to Start->MS-DOS Prompt and then drag the program to the command prompt window and press enter. It will run the program, and the data is still there in the window even after it finished. That's the way to do it, in my opinion. |
As a quick note: conio.h is also in the delorie djgpp compiler libraries.
I also used conio just to keep the program open, but for instance a little nuisance occurs when you have a input stream, after which you have to press enter to read it. The program, in many of my programs, executes so fast that it also reads the getch(), or whatever, and terminates :) |
| All times are GMT -5. The time now is 9:16 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC