描述:
是这样的:有一个组合控件(带源码的),我将其放置在对话框应用程序中,一切正常。但是我想将其包到ocx中,却总是报错,而且其报错原因,感觉有点莫名其妙。
错误如下:
d:\application\vc6\msdev98\myprojects\test\testocx\fontcombobox.h(13) : error C2011: 'CFontComboBox' : 'class' type redefinition
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(52) : error C2039: 'SetMaxWidth' : is not a member of 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(52) : error C2039: 'GetMaxWidth' : is not a member of 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(52) : error C2039: 'GetMaxWidth' : is not a member of 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(75) : error C2065: 'm_maxWidth' : undeclared identifier
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(93) : error C2509: '_GetBaseMessageMap' : member function not declared in 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(93) : error C2509: 'GetMessageMap' : member function not declared in 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(93) : warning C4273: 'protected: static struct AFX_MSGMAP const CWnd::messageMap' : inconsistent dll linkage. dllexport assumed.
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(93) : error C2491: 'CFontComboBox::CComboBox::CWnd::messageMap' : definition of dllimport static data member not allowed
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(95) : error C2065: 'OnDropdown' : undeclared identifier
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(95) : error C2440: 'type cast' : cannot convert from 'int *' to 'void (__thiscall CCmdTarget::*)(void)'
There is no context in which this conversion is possible
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(102) : error C2039: 'OnDropdown' : is not a member of 'CFontComboBox'
d:\application\vc98\mfc\include\afxctl.h(1776) : see declaration of 'CFontComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\FontComboBox.cpp(116) : fatal error C1903: unable to recover from previous error(s); stopping compilation
RRECToolbar.cpp
d:\application\vc6\msdev98\myprojects\test\testocx\fontcombobox.h(13) : error C2011: 'CFontComboBox' : 'class' type redefinition
d:\application\vc6\msdev98\myprojects\test\testocx\sizecombobox.h(13) : error C2011: 'CSizeComboBox' : 'class' type redefinition
d:\application\vc6\msdev98\myprojects\test\testocx\rrectoolbar.h(12) : fatal error C1083: Cannot open include file: 'External/ColourPicker.h': No such file or directory
RulerRichEditCtrl.cpp
d:\application\vc6\msdev98\myprojects\test\testocx\fontcombobox.h(13) : error C2011: 'CFontComboBox' : 'class' type redefinition
d:\application\vc6\msdev98\myprojects\test\testocx\sizecombobox.h(13) : error C2011: 'CSizeComboBox' : 'class' type redefinition
d:\application\vc6\msdev98\myprojects\test\testocx\rrectoolbar.h(12) : fatal error C1083: Cannot open include file: 'External/ColourPicker.h': No such file or directory
SizeComboBox.cpp
d:\application\vc6\msdev98\myprojects\test\testocx\sizecombobox.h(13) : error C2011: 'CSizeComboBox' : 'class' type redefinition
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(46) : error C2084: function '__thiscall CSizeComboBox::CSizeComboBox(void)' already has a body
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(61) : error C2084: function '__thiscall CSizeComboBox::~CSizeComboBox(void)' already has a body
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(65) : error C2509: '_GetBaseMessageMap' : member function not declared in 'CSizeComboBox'
d:\application\vc98\mfc\include\afxctl.h(1756) : see declaration of 'CSizeComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(65) : error C2509: 'GetMessageMap' : member function not declared in 'CSizeComboBox'
d:\application\vc98\mfc\include\afxctl.h(1756) : see declaration of 'CSizeComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(65) : warning C4273: 'protected: static struct AFX_MSGMAP const CWnd::messageMap' : inconsistent dll linkage. dllexport assumed.
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(65) : error C2491: 'CSizeComboBox::CComboBox::CWnd::messageMap' : definition of dllimport static data member not allowed
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(74) : error C2039: 'SelectSize' : is not a member of 'CSizeComboBox'
d:\application\vc98\mfc\include\afxctl.h(1756) : see declaration of 'CSizeComboBox'
D:\APPLICATION\VC6\MSDEV98\MYPROJECTS\TEST\testocx\SizeComboBox.cpp(88) : fatal error C1903: unable to recover from previous error(s); stopping compilation
TestocxCtl.cpp
d:\application\vc6\msdev98\m