Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I'm kinda new to the C++ community and I'm having a problem. A good friend left me some closed source code, and put a lot of hard work into it. He's moving to Russia, so he's all done with the project.
Now let me tell you one thing, this guy is a literal genious, so I doubt the code has as many errors as MSVC++ states it has. Friend tell me that it may be because he used a different compiler, or the language is different, I dont know. But any help would be appreciated.
Heres a sample error:
Compiling...
graysvr.cpp
c:\program files\icq\received files\menace\common\cscriptobj.h(101) : error C2664: 'wvsprintfA' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\icq\received files\menace\common\cscriptobj.h(102) : error C2664: 'SysMessage' : cannot convert parameter 1 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Basically, heres the code portion:
class CTextConsole
{
// A base class for any class that can act like a console and issue commands.
// CClient, CChar, CServer, CFileConsole
protected:
int OnConsoleKey( CGString & sText, TCHAR nChar, bool fEcho );
public:
// What privs do i have ?
virtual CAccountRef GetAccount() const
{
return NULL;
}
virtual PLEVEL_TYPE GetPrivLevel() const = 0;
virtual LPCTSTR GetName() const = 0; // ( every object must have at least a type name )
virtual CChar * GetChar() const; // are we also a CChar ? dynamic_cast ?
virtual void SysMessage( LPCTSTR pszMessage, WORD wHue = 0 ) const = 0; // Feed back message.
int VSysMessage( LPCTSTR pszFormat, va_list args ) const
{
TCHAR szTemp;
size_t ilen = vsprintf( szTemp, pszFormat, args );
SysMessage( szTemp );
return( ilen );
}
int _cdecl SysMessagef( LPCTSTR pszFormat, ... ) const
{
va_list vargs;
va_start( vargs, pszFormat );
int iRet = VSysMessage( pszFormat, vargs );
va_end( vargs );
return( iRet );
}
};
This error really gets me too:
c:\program files\icq\received files\menace\graysvr\graysvr.cpp(92) : error C2078: too many initializers
It looks like this in the code:
LPCTSTR const g_Stat_Name = // not sorted obviously.
{
"STR",
"INT",
"DEX",
"KARMA",
"FAME",
// "OSTR",
// "OINT",
// "ODEX",
// "MAXHITS",
// "MAXMANA",
// "MAXSTAM",
};
Where as INT is intellegence, (for a game emulator)
Any help in this would be GREATLY appreciated, thanks.
Now let me tell you one thing, this guy is a literal genious, so I doubt the code has as many errors as MSVC++ states it has. Friend tell me that it may be because he used a different compiler, or the language is different, I dont know. But any help would be appreciated.
Heres a sample error:
Compiling...
graysvr.cpp
c:\program files\icq\received files\menace\common\cscriptobj.h(101) : error C2664: 'wvsprintfA' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
c:\program files\icq\received files\menace\common\cscriptobj.h(102) : error C2664: 'SysMessage' : cannot convert parameter 1 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Basically, heres the code portion:
class CTextConsole
{
// A base class for any class that can act like a console and issue commands.
// CClient, CChar, CServer, CFileConsole
protected:
int OnConsoleKey( CGString & sText, TCHAR nChar, bool fEcho );
public:
// What privs do i have ?
virtual CAccountRef GetAccount() const
{
return NULL;
}
virtual PLEVEL_TYPE GetPrivLevel() const = 0;
virtual LPCTSTR GetName() const = 0; // ( every object must have at least a type name )
virtual CChar * GetChar() const; // are we also a CChar ? dynamic_cast ?
virtual void SysMessage( LPCTSTR pszMessage, WORD wHue = 0 ) const = 0; // Feed back message.
int VSysMessage( LPCTSTR pszFormat, va_list args ) const
{
TCHAR szTemp;
size_t ilen = vsprintf( szTemp, pszFormat, args );
SysMessage( szTemp );
return( ilen );
}
int _cdecl SysMessagef( LPCTSTR pszFormat, ... ) const
{
va_list vargs;
va_start( vargs, pszFormat );
int iRet = VSysMessage( pszFormat, vargs );
va_end( vargs );
return( iRet );
}
};
This error really gets me too:
c:\program files\icq\received files\menace\graysvr\graysvr.cpp(92) : error C2078: too many initializers
It looks like this in the code:
LPCTSTR const g_Stat_Name = // not sorted obviously.
{
"STR",
"INT",
"DEX",
"KARMA",
"FAME",
// "OSTR",
// "OINT",
// "ODEX",
// "MAXHITS",
// "MAXMANA",
// "MAXSTAM",
};
Where as INT is intellegence, (for a game emulator)
Any help in this would be GREATLY appreciated, thanks.