Using VC6 code in VS 2005
- From: "Dave Cullen" <nospam@xxxxxxxx>
- Date: Mon, 31 Dec 2007 10:55:50 -0500
I'm trying to reuse a database class module that I created with VC 6.0 in
Visual Studio 2005 and I'm getting a whole bunch of errors and warnings.
Most of them refer to data types being different than the current
definitions of functions that I'm using.
Examples:
If I cursor over SqlDriverConnect(..) the Intellisense says "#define
SqlDriverConnect SqlDriverConnectW" and the compiler balks at my connect
string being a char array. How do I "undefine" that?
Same with MessageBox now being #defined as MessageBoxW, and the compiler
won't accept literal strings or char arrays as parameters.
Some functions give errors like "cannot convert from 'char[80]' to 'LPTSTR'.
Both are char strings, no?
This one blows my mind:
// convert CString to number
int NumRecords = atoi(num_records.GetBuffer(3));
Compiler says atoi cannot convert parameter 1 from 'w_char_t' to 'const
char*'. Huh? CString::GetBuffer() dosn't return char any more?
I also get a slew of warnings about "depreciated" functions like strcpy and
strcat. I don't care, I use them.
Is there any way to set the compiler to use the old definitions, so I don't
have to rewrite my class module?
Thanks.
.
- Follow-Ups:
- Re: Using VC6 code in VS 2005
- From: Scott McPhillips [MVP]
- Re: Using VC6 code in VS 2005
- From: Carl Daniel [VC++ MVP]
- Re: Using VC6 code in VS 2005
- Prev by Date: Re: MSDN volatile sample
- Next by Date: Re: MSDN volatile sample
- Previous by thread: Re: Double-Checked Locking pattern issue
- Next by thread: Re: Using VC6 code in VS 2005
- Index(es):
Relevant Pages
|
Loading