描述:
修改一位前辈的工具,里面的grid++不知道是什么版本,以前是在VC6.0上面开发。
(1)怎样知道他是用哪一个版本做的?因为控件位置是黑色的,加载不了。
(2)我现在用的是grid++ 4.5的版本,当按照帮助文件应用新的4.5的控件后,以前编译成功的文件,出现了好几个没有定义的类。我用以前编译成功的看了一下,这些的定义都出现在了\Debug\grpro.tlh中,但是我已经将相关的grpro.tlb和 grdes.tlb文件更新了。
代码出现错误的地方:
void CMON_HislogEvent::FetchRecord(VARIANT_BOOL *pEof)
{
struct LOG_MSG4BUF* pMsgBuf;
CString ty, body;
POSITION pos;
COleDateTime oleDate;
IGRDateTimeFieldPtr time =m_pGridppReport->FieldByName("TIME")->AsDateTimeField; //husong
IGRStringFieldPtr type =m_pGridppReport->FieldByName("TYPE")->AsStringField;
IGRStringFieldPtr record =m_pGridppReport->FieldByName("RECORD")->AsStringField;
IGRIntegerFieldPtr pointer =m_pGridppReport->FieldByName("POINTER")->AsIntegerField;
pos=m_pBuf->m_queue.GetHeadPosition();
while(NULL!=pos)
{
pMsgBuf=m_pBuf->m_queue.GetNext(pos);
m_msg.LoadMsg(pMsgBuf);
if(!m_pFilter->IfEnableMsg(m_msg.m_msg.type))
continue;
m_pGridppReport->DetailGrid->Recordset->Append();
time->Value=COleDateTime(m_msg.m_msg.time);
ty="";
body="";
if(OK==m_msg.GetTypeBody(ty, body))
{
type->Value=(LPCTSTR)ty;
record->Value=(LPCTSTR)body;
}
pointer->Value=(unsigned __int32)pMsgBuf;
m_pGridppReport->DetailGrid->Recordset->Post();
}
出现的错误:--------------------Configuration: Monitor - Win32 Debug--------------------
Compiling...
MON_HislogEvent.cpp
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(46) : error C2065: 'IGRDateTimeFieldPtr' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(46) : error C2146: syntax error : missing ';' before identifier 'time'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(46) : error C2039: 'AsDateTimeField' : is not a member of 'IGRField'
e:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\monitor_modify_8_22\debug\grpro.tlh(4690) : see declaration of 'IGRField'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(47) : error C2065: 'IGRStringFieldPtr' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(47) : error C2146: syntax error : missing ';' before identifier 'type'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(47) : error C2065: 'type' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(47) : error C2039: 'AsStringField' : is not a member of 'IGRField'
e:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\monitor_modify_8_22\debug\grpro.tlh(4690) : see declaration of 'IGRField'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(48) : error C2146: syntax error : missing ';' before identifier 'record'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(48) : error C2065: 'record' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(48) : error C2039: 'AsStringField' : is not a member of 'IGRField'
e:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\monitor_modify_8_22\debug\grpro.tlh(4690) : see declaration of 'IGRField'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(49) : error C2065: 'IGRIntegerFieldPtr' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(49) : error C2146: syntax error : missing ';' before identifier 'pointer'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(49) : error C2065: 'pointer' : undeclared identifier
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(49) : error C2039: 'AsIntegerField' : is not a member of 'IGRField'
e:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\monitor_modify_8_22\debug\grpro.tlh(4690) : see declaration of 'IGRField'
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(59) : error C2227: left of '->Value' must point to class/struct/union
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(64) : error C2227: left of '->Value' must point to class/struct/union
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(65) : error C2227: left of '->Value' must point to class/struct/union
E:\0409工作\mmi2008_6_16g4.5\mmi2008_6_16\Monitor_modify_8_22\MON_HislogEvent.cpp(67) : error C2227: left of '->Value' must point to class/struct/union
执行 cl.exe 时出错.
(对不起大家了,没有积分)