|
I get the following errors when compiling the UNICODE version:
1. matrixctrl.cpp(51): error C2664: 'CFont::CreateFontW' : cannot convert parameter 14 from 'const char [7]' to 'LPCTSTR'
2. matrixctrl.cpp(284): error C2440: 'initializing' : cannot convert from 'const char [20]' to 'ATL::CStringT<BaseType,StringTraits>'
3. matrixctrl.cpp(347): error C2440: 'initializing' : cannot convert from 'const char [20]' to 'ATL::CStringT<BaseType,StringTraits>'
4. matrixctrl.cpp(443): error C2664: 'BOOL CDC::TextOutW(int,int,LPCTSTR,int)' : cannot convert parameter 3 from 'const char [2]' to 'LPCTSTR'
5. matrixctrl.cpp(511): error C2664: 'int CDC::DrawTextW(const CString &,LPRECT,UINT)' : cannot convert parameter 1 from 'const char [27]' to 'const CString &'
To fix this:
Add _T() in 1. - 5. and around all "".
Andreas.
|
|
|
|
|
Hello,
I compiled your code with Visual Studio 2005 with the C++ Code Analyzer enabled an get the following warnings:
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
d:\devtemp\matrixctrl\matrix.cpp(50) : warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed. You should remove this call.
d:\devtemp\matrixctrl\matrixctrl.cpp(315) : warning C6246: Local declaration of 'strTemp' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '248' of 'd:\devtemp\matrixctrl\matrixctrl.cpp': Lines: 248
Andreas.
|
|
|
|
|
Hello,
I get the following warnings/errors compiling with Visual Studio 2005.
------ Build started: Project: matrix, Configuration: Release Win32 ------
Compiling...
StdAfx.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
Compiling...
matrixDlg.cpp
MatrixCtrl.cpp
.\MatrixCtrl.cpp(385) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
.\MatrixCtrl.cpp(405) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
.\MatrixCtrl.cpp(413) : error C2593: 'operator =' is ambiguous
C:\Programme\Microsoft Visual Studio 8\VC\atlmfc\include\cstringt.h(1315): could be 'ATL::CStringT<basetype,stringtraits> &ATL::CStringT<basetype,stringtraits>::operator =(wchar_t)'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
C:\Programme\Microsoft Visual Studio 8\VC\atlmfc\include\cstringt.h(1308): or 'ATL::CStringT<basetype,stringtraits> &ATL::CStringT<basetype,stringtraits>::operator =(char)'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
while trying to match the argument list '(CString, int)'
.\MatrixCtrl.cpp(423) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
.\MatrixCtrl.cpp(441) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
matrix.cpp
.\matrix.cpp(50) : warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed. You should remove this call.
C:\Programme\Microsoft Visual Studio 8\VC\atlmfc\include\afxwin.h(4477) : see declaration of 'CWinApp::Enable3dControls'
Generating Code...
matrix - 5 error(s), 1 warning(s)
------ Build started: Project: matrix, Configuration: Debug Win32 ------
Compiling...
StdAfx.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
Compiling...
matrix.cpp
d:\devtemp\matrixctrl\matrix.cpp(50) : warning C4996: 'CWinApp::Enable3dControls': CWinApp::Enable3dControls is no longer needed. You should remove this call.
c:\programme\microsoft visual studio 8\vc\atlmfc\include\afxwin.h(4477) : see declaration of 'CWinApp::Enable3dControls'
MatrixCtrl.cpp
d:\devtemp\matrixctrl\matrixctrl.cpp(385) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
d:\devtemp\matrixctrl\matrixctrl.cpp(405) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
d:\devtemp\matrixctrl\matrixctrl.cpp(413) : error C2593: 'operator =' is ambiguous
c:\programme\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(1315): could be 'ATL::CStringT<basetype,stringtraits> &ATL::CStringT<basetype,stringtraits>::operator =(wchar_t)'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
c:\programme\microsoft visual studio 8\vc\atlmfc\include\cstringt.h(1308): or 'ATL::CStringT<basetype,stringtraits> &ATL::CStringT<basetype,stringtraits>::operator =(char)'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
while trying to match the argument list '(CString, int)'
d:\devtemp\matrixctrl\matrixctrl.cpp(423) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
d:\devtemp\matrixctrl\matrixctrl.cpp(441) : error C2440: 'initializing' : cannot convert from 'int' to 'ATL::CStringT<basetype,stringtraits>'
with
[
BaseType=char,
StringTraits=StrTraitMFC_DLL<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
matrixDlg.cpp
Generating Code...
matrix - 5 error(s), 1 warning(s)
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
Andreas.
|
|
|
|
|
can you guys convert the code to VB6 or VB.Net? i know nothing about C++. thanks.
jun
|
|
|
|
|
Compiling with Flag /Wp64 set, you get the warning:
d:\Dev\Mirador\Mirador\MatrixCtrl.cpp(107) : warning C4312: 'type cast' : conversion from 'UINT' to 'HMENU' of greater size
Solution:
Change the line in CMatrixCtrl::Create
from
bResult = CWnd::CreateEx(WS_EX_CLIENTEDGE,
className, NULL, dwStyle,
rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top,
pParentWnd->GetSafeHwnd(), (HMENU)nID);
to
bResult = CWnd::CreateEx(WS_EX_CLIENTEDGE,
className, NULL, dwStyle,
rect, pParentWnd, nID);
Greetings
Andreas.
|
|
|
|
|
hello,
Great job you have done.
But in more than one case you directly assign an int value to CString
as following:
CString strTextOut = m_MatrixColumns[i].pItem[m_MatrixColumns[i].nCounter].character;
This will fail to compile in VC7. So I make some corrections as folling:
CString strTextOut;
strTextOut.Format("%d",m_MatrixColumns[nStartColumn].pItem[0].character);
there is another runtime check error .
int nStartColumn;
nStartColumn is used before assign any value.
I correct like this:
int nStartColumn =rand() % m_nCols;;
|
|
|
|
|
hello,
Great job you have done.
But in more than one case you directly assign an int value to CString
as following:
CString strTextOut = m_MatrixColumns[i].pItem[m_MatrixColumns[i].nCounter].character;
This will fail to compile in VC7. So I make some corrections as folling:
CString strTextOut;
strTextOut.Format("%d",m_MatrixColumns[nStartColumn].pItem[0].character);
there is another runtime check error .
int nStartColumn;
nStartColumn is used before assign any value.
I correct like this:
int nStartColumn =rand() % m_nCols;;
|
|
|
|
|
It deserves a '10'.
William
|
|
|
|
|
|
Ouch,
I actually felt physically like puking at the beginning of Spiderman by that effect.
It was encompassing.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
I am sick of fighting with Martin, I think I will ignore his posts from here on in, and spend the time working on articles instead.
Christian Graus
|
|
|
|
|
Cool. I like it.
One small problem, easy to fix. Obviously timer 2 is running to early when m_dcMatrix is still NULL. Or depends this on the speed of the CPU? I have a P3-600.
Thomas Haase
|
|
|
|
|
Easy Fix by add line " if ( !m_dcMatrix ) break ; " before m_dcMatrix.GetTextMetrics(&tm);
|
|
|
|
|
This is a cool control, looks great when run on a fast computer. Maybe it's my computer that is at fault, but when I run the demo on my P2-400, the text is totally unreadable, almost as if it is only half drawn.
So I built and tried to run the debug version, and I got an assertion :
- File "afxWin1.inl" line 857
-- {ASSERT(m_hAttribDC != NULL);
which is called from line 350 in the file MatrixCtrl.cpp :
m_dcMatrix.GetTextMetrics(&tm);
Also, a suggestion to make it easier for users to use the control :
In the OnInitDialog function, instead of having the the user calculate the rectangle for the control before they call CMatrixCtrl::Create(), why not just have the user pass in the ID of the control in the nID parameter, and you calculate the rect in the Create() member function. Just be sure to pass NULL as the nID parameter in your call to CWnd::CreateEx().
CPUA 0x5041
Sonork 100.11743 Chicken Little
My pet, My pet stick
Nicer than a twig
Cooler than a rock.
(Microsoft ad)
Within you lies the power for good - Use it!
|
|
|
|
|
So we have StarWars, Matrix as of now.
I wonder what is going to be next?
BTW, Great Job (and it doesnot even use DirectX)
Step back, rub your eyes, take a deep breath, stretch a bit, and reflect on the relative importance of CP, CG, the age / travel time sustained by supposedly 'fresh' cheese curds, and Life in General. - Shog9
|
|
|
|
|
This is a Real Beauty
Great Man
|
|
|
|
|
Another nice one, Pablo! Good work!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|