Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 20th, 2005, 10:09 PM   #1
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
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?
357mag is offline   Reply With Quote
Old Apr 20th, 2005, 10:15 PM   #2
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
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.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Apr 20th, 2005, 10:45 PM   #3
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
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.
357mag is offline   Reply With Quote
Old Apr 21st, 2005, 2:07 AM   #4
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
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

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.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Apr 21st, 2005, 11:12 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I know for a fact conio.h was available in Microsoft Visual C++ 6 - not sure about .NET, but it's probably still there.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 21st, 2005, 1:21 PM   #6
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
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.

Last edited by 357mag; Apr 21st, 2005 at 1:24 PM.
357mag is offline   Reply With Quote
Old Apr 21st, 2005, 4:41 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
They do. You can also use getchar(); which is included in stdio.h.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 21st, 2005, 7:47 PM   #8
iignotus
Professional Programmer
 
iignotus's Avatar
 
Join Date: Apr 2005
Location: Nowhere Special
Posts: 466
Rep Power: 4 iignotus is on a distinguished road
Send a message via AIM to iignotus
>>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.
__________________
% rc4 hexkey < input > output
#define S ,t=s[i],s[i]=s[j],s[j]=t /* rc4 hexkey <file */
unsigned char k[256],s[256],i,j,t;main(c,v,e)char**v;{++v;while(++i)s[ 
i]=i;for(c=0;*(*v)++;k[c++]=e)sscanf((*v)++-1,"%2x",&e);while(j+=s[i]
+k[i%c]S,++i);for(j=0;c=~getchar();putchar(~c^s[t+=s[i]]))j+=s[++i]S;}
iignotus is offline   Reply With Quote
Old Apr 22nd, 2005, 7:59 AM   #9
Starter
Programmer
 
Starter's Avatar
 
Join Date: Apr 2005
Location: Estonia
Posts: 42
Rep Power: 0 Starter is on a distinguished road
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
__________________
Uhuuu!

Last edited by Starter; Apr 22nd, 2005 at 8:03 AM.
Starter is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC