Click to See Complete Forum and Search --> : Will someone please... (source code attached).....


JamesSchumacher
May 16th, 2006, 11:03 AM
I am not at a compiler, and cannot get access to one very easily atm. (I'm writing code in WordPad/Notepad >.> )

Will someone compile the source code in the attached *.zip file for me and report back to me any errors. It is a complete Win32 application.

Thank you.

ovidiucucu
May 16th, 2006, 11:14 AM
I am not at a compiler
I am not a compiler either but I have one. :D ;)
Here is the report:

--------------------Configuration: PRJ2 - Win32 Debug--------------------
Compiling...
XTR.UnicodeString.cpp
C:\tempy\PRJ2\XTR.UnicodeString.cpp(355) : error C2374: 'x' : redefinition; multiple initialization
C:\tempy\PRJ2\XTR.UnicodeString.cpp(338) : see declaration of 'x'
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2310) : error C2065: 'DetermineBufferSize' : undeclared identifier
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2641) : error C2147: 'ucBits1' : const automatic array must be fully initialized
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2865) : error C2039: 'WideCharToMultiByte' : is not a member of '`global namespace''
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2865) : error C2065: 'WideCharToMultiByte' : undeclared identifier
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2865) : error C2065: 'CP_ACP' : undeclared identifier
C:\tempy\PRJ2\XTR.UnicodeString.cpp(2865) : error C2065: 'WC_COMPOSITECHECK' : undeclared identifier
EditorWindow.cpp
c:\tempy\prj2\editorwindow.cpp(42) : error C2664: 'SetPropA' : cannot convert parameter 3 from 'const void *' to 'void *'
Conversion loses qualifiers
c:\tempy\prj2\editorwindow.cpp(79) : error C2660: 'UnregisterClassA' : function does not take 1 parameters
c:\tempy\prj2\editorwindow.cpp(86) : error C2065: 'ICC_STANDARD_CLASSES' : undeclared identifier
StringTable.cpp
C:\tempy\PRJ2\StringTable.cpp(219) : error C2511: 'RemoveEntry' : overloaded member function 'bool (unsigned long)' not found in 'StringTable'
c:\tempy\prj2\stringtable.h(73) : see declaration of 'StringTable'
C:\tempy\PRJ2\StringTable.cpp(241) : error C2065: 'm_dwLength' : undeclared identifier
C:\tempy\PRJ2\StringTable.cpp(317) : error C2065: 'Type' : undeclared identifier
C:\tempy\PRJ2\StringTable.cpp(317) : error C2065: 'pNewData' : undeclared identifier
C:\tempy\PRJ2\StringTable.cpp(317) : error C2440: '=' : cannot convert from 'class StringTableEntry *' to 'int'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
C:\tempy\PRJ2\StringTable.cpp(324) : error C2440: '=' : cannot convert from 'int' to 'class StringTableEntry *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
C:\tempy\PRJ2\StringTable.cpp(347) : error C2065: 'GetLength' : undeclared identifier
C:\tempy\PRJ2\StringTable.cpp(348) : error C2039: 'GetLength' : is not a member of 'StringTable'
c:\tempy\prj2\stringtable.h(73) : see declaration of 'StringTable'
C:\tempy\PRJ2\StringTable.cpp(379) : error C2039: 'GetLength' : is not a member of 'StringTable'
c:\tempy\prj2\stringtable.h(73) : see declaration of 'StringTable'
StringTableEditor.cpp
C:\tempy\PRJ2\StringTableEditor.cpp(130) : error C2664: 'CreateCompatibleDC' : cannot convert parameter 1 from 'struct HWND__ *' to 'struct HDC__ *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\tempy\PRJ2\StringTableEditor.cpp(136) : error C2039: 'biBitsPerPixel' : is not a member of 'tagBITMAPINFOHEADER'
c:\p\visualstudio6\vc98\include\wingdi.h(623) : see declaration of 'tagBITMAPINFOHEADER'
C:\tempy\PRJ2\StringTableEditor.cpp(141) : error C2039: 'biXPixelsPerMeter' : is not a member of 'tagBITMAPINFOHEADER'
c:\p\visualstudio6\vc98\include\wingdi.h(623) : see declaration of 'tagBITMAPINFOHEADER'
C:\tempy\PRJ2\StringTableEditor.cpp(142) : error C2039: 'biYPixelsPerMeter' : is not a member of 'tagBITMAPINFOHEADER'
c:\p\visualstudio6\vc98\include\wingdi.h(623) : see declaration of 'tagBITMAPINFOHEADER'
C:\tempy\PRJ2\StringTableEditor.cpp(171) : error C2039: 'MoveTo' : is not a member of '`global namespace''
C:\tempy\PRJ2\StringTableEditor.cpp(171) : error C2065: 'MoveTo' : undeclared identifier
C:\tempy\PRJ2\StringTableEditor.cpp(454) : error C2666: 'RemoveEntry' : 2 overloads have similar conversions
C:\tempy\PRJ2\StringTableEditor.cpp(461) : error C2143: syntax error : missing ';' before ':'
C:\tempy\PRJ2\StringTableEditor.cpp(463) : error C2065: 'dwEntryCount' : undeclared identifier
C:\tempy\PRJ2\StringTableEditor.cpp(559) : error C2143: syntax error : missing ')' before ';'
C:\tempy\PRJ2\StringTableEditor.cpp(568) : error C2440: '=' : cannot convert from 'char [36]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\tempy\PRJ2\StringTableEditor.cpp(598) : error C2143: syntax error : missing ')' before ';'
C:\tempy\PRJ2\StringTableEditor.cpp(607) : error C2440: '=' : cannot convert from 'char [36]' to 'const unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
StringTableEntry.cpp
C:\tempy\PRJ2\StringTableEntry.cpp(96) : error C2039: 'Reserve' : is not a member of 'AnsiString'
c:\tempy\prj2\xtr.string.h(16) : see declaration of 'AnsiString'
StringTableFile.cpp
C:\tempy\PRJ2\StringTableFile.cpp(98) : error C2065: 'm_dwEntryCount' : undeclared identifier
C:\tempy\PRJ2\StringTableFile.cpp(129) : error C2511: 'Save' : overloaded member function 'bool (const class XTR::UnicodeString &)' not found in 'StringTableFile'
c:\tempy\prj2\stringtable.h(116) : see declaration of 'StringTableFile'
C:\tempy\PRJ2\StringTableFile.cpp(328) : error C2511: '=' : overloaded member function 'const class StringTableFile &(const class StringTableFile &)' not found in 'StringTable'
c:\tempy\prj2\stringtable.h(73) : see declaration of 'StringTable'
C:\tempy\PRJ2\StringTableFile.cpp(416) : error C2556: 'const class StringTable &__thiscall StringTable::operator [](unsigned long) const' : overloaded function differs only by return type from 'const class StringTableEntry &__thiscall StringTable::o
perator [](unsigned long) const'
c:\tempy\prj2\stringtable.h(98) : see declaration of '[]'
C:\tempy\PRJ2\StringTableFile.cpp(416) : error C2371: '[]' : redefinition; different basic types
c:\tempy\prj2\stringtable.h(98) : see declaration of '[]'
C:\tempy\PRJ2\StringTableFile.cpp(417) : error C2065: 'm_pTables' : undeclared identifier
C:\tempy\PRJ2\StringTableFile.cpp(417) : error C2109: subscript requires array or pointer type
C:\tempy\PRJ2\StringTableFile.cpp(421) : error C2556: 'class StringTable &__thiscall StringTable::operator [](unsigned long)' : overloaded function differs only by return type from 'class StringTableEntry &__thiscall StringTable::operator [](unsigne
d long)'
c:\tempy\prj2\stringtable.h(99) : see declaration of '[]'
C:\tempy\PRJ2\StringTableFile.cpp(421) : error C2371: '[]' : redefinition; different basic types
c:\tempy\prj2\stringtable.h(99) : see declaration of '[]'
C:\tempy\PRJ2\StringTableFile.cpp(422) : error C2109: subscript requires array or pointer type
XTR.AnsiString.cpp
c:\tempy\prj2\xtr.ansistring.cpp(355) : error C2374: 'x' : redefinition; multiple initialization
c:\tempy\prj2\xtr.ansistring.cpp(338) : see declaration of 'x'
c:\tempy\prj2\xtr.ansistring.cpp(2841) : error C2039: 'MultiByteToWideChar' : is not a member of '`global namespace''
c:\tempy\prj2\xtr.ansistring.cpp(2841) : error C2065: 'MultiByteToWideChar' : undeclared identifier
c:\tempy\prj2\xtr.ansistring.cpp(2841) : error C2065: 'CP_ACP' : undeclared identifier
c:\tempy\prj2\xtr.ansistring.cpp(2841) : error C2065: 'MB_PRECOMPOSED' : undeclared identifier
Error executing cl.exe.

PRJ2.exe - 48 error(s), 0 warning(s)

JamesSchumacher
May 16th, 2006, 11:42 AM
Could you compile this modified code now?

I think I fixed all of the errors, but you never know >.>.

Alot of the errors were simply forgetting to include 'StdAfx.h' in XTR.AnsiString.cpp and XTR.UnicodeString.cpp. <.<

Also, if it compiles and links fine, please zip up a release version of the *.exe - it would be greatly appreciated.

Thank you.

ovidiucucu
May 16th, 2006, 12:29 PM
forgetting to include 'StdAfx.h'...
That was my first try also.
However, few errors remained.
For example, MoveTo is an old Windows 3.x function and has to be replaced with MoveToEx.
Now I have compiled with VS2003 insted of VS6.0 because you use some new SDK stuff like for example ICC_STANDARD_CLASSES. That way I got rid of some VC6.0 errors but got more warnings instead.

Another errors: You have few undeclared identifiers and additionally DetermineBufferSize is not a member of UnicodeString.

Well, here is the new report.
------ Rebuild All started: Project: TST, Configuration: Debug Win32 ------

Deleting intermediate files and output files for project 'TST', configuration 'Debug|Win32'.
Compiling...
XTR.AnsiString.cpp
c:\tempy\PRJ4\TST\XTR.AnsiString.cpp(1528) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.AnsiString.cpp(1610) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.AnsiString.cpp(1689) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.AnsiString.cpp(1805) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
WinMain.cpp
StringTableFile.cpp
c:\tempy\PRJ4\TST\StringTableFile.cpp(44) : error C2065: 'm_dwTableCount' : undeclared identifier
StringTableEntry.cpp
c:\tempy\PRJ4\TST\StringTableEntry.cpp(96) : error C2440: 'initializing' : cannot convert from 'bool' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
StringTableEditor.cpp
c:\tempy\PRJ4\TST\StringTableEditor.cpp(171) : error C2039: 'MoveTo' : is not a member of 'operator``global namespace'''
c:\tempy\PRJ4\TST\StringTableEditor.cpp(171) : error C3861: 'MoveTo': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\StringTableEditor.cpp(380) : warning C4244: 'argument' : conversion from 'INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(423) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(429) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(454) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(454) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(462) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(475) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(491) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(499) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(505) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(536) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(536) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(638) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(652) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(652) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(666) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
c:\tempy\PRJ4\TST\StringTableEditor.cpp(666) : warning C4244: 'argument' : conversion from 'const INT_PTR' to 'unsigned long', possible loss of data
StringTable.cpp
c:\tempy\PRJ4\TST\StringTable.cpp(241) : error C2065: 'm_dwLength' : undeclared identifier
c:\tempy\PRJ4\TST\StringTable.cpp(378) : error C3861: 'GetLength': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\StringTable.cpp(379) : error C2039: 'GetLength' : is not a member of 'StringTable'
c:\tempy\PRJ4\TST\StringTable.h(73) : see declaration of 'StringTable'
EditorWindow.cpp
c:\tempy\PRJ4\TST\EditorWindow.cpp(42) : error C2440: 'return' : cannot convert from 'BOOL' to 'const void *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
XTR.UnicodeString.cpp
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(1528) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(1610) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(1689) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(1805) : warning C4267: 'initializing' : conversion from 'size_t' to 'const unsigned long', possible loss of data
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2311) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2343) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2382) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2425) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2463) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2495) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2534) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
c:\tempy\PRJ4\TST\XTR.UnicodeString.cpp(2577) : error C3861: 'DetermineBufferSize': identifier not found, even with argument-dependent lookup
Generating Code...

Build log was saved at "file://c:\tempy\Prj4\Tst\Debug\BuildLog.htm"
TST - 16 error(s), 25 warning(s)

JamesSchumacher
May 16th, 2006, 01:22 PM
Thank you.

I fixed all the errors now. With only 16 errors generated (from just a few mistakes) and I have it all fixed. I also used:


#pragma warning(disable:4267)

// and

#pragma warning(disable:4244)


That will get rid of the warnings.

And thank you for compiling it with VS 2003. I wanted to get all of the errors out of the original code before turning it into an MDI application.