简体   繁体   English

C ++:使用owl重新编译旧代码

[英]C++: recompiling old code using owl

I'm trying to compile an old program with the new Borland C++-Builder (Embarcadero Studio XE2). 我正在尝试使用新的Borland C ++-Builder(Embarcadero Studio XE2)编译旧程序。

I thought it would be easy, but I get a lot of errors. 我以为会很容易,但是却遇到很多错误。 eg using something like somefunction(TPoint(0,0)) won't work when it's expecting a reference, so I had to write TPoint t=TPoint(0,0);somefunction(t) ... also some errors like math.log could work with double of float but got uint, so it can't decide... 例如,使用诸如somefunction(TPoint(0,0))东西在期望引用时将无法正常工作,因此我不得不编写TPoint t=TPoint(0,0);somefunction(t) ...还有一些错误,例如数学.log可以使用double浮点数但可以使用uint,因此无法确定...

But the main Problem seems to regard OWL. 但是主要的问题似乎与OWL有关。 I have a codeline there that says something about mismatching function parameter types: 我在那儿有一条代码行,上面写着有关不匹配的函数参数类型的内容:

DEFINE_RESPONSE_TABLE1(TTSCalibDialog, TDialog) EV_LVN_ENDLABELEDIT(IDC_CALIBMASSES, MassCol_EndLableEditResp), EV_COMMAND(IDC_CALIBRATEBUT, CalibrateResp), EV_COMMAND(IDC_CALIBSAVEBUT, CalibSaveResp), EV_COMMAND(IDC_CALIBLOADBUT, CalibLoadResp), EV_COMMAND(IDC_CALIBRESTORE, CalibRestoreResp), EV_COMMAND(IDC_CALIBSETNUMMASSES, CalibSetNumMassesResp), EV_WM_DESTROY, // Ev_WM_Destroy END_RESPONSE_TABLE; DEFINE_RESPONSE_TABLE1(TTSCalibDialog,TDialog)EV_LVN_ENDLABELEDIT(IDC_CALIBMASSES,MassCol_EndLableEditResp),EV_COMMAND(IDC_CALIBRATEBUT,CalibrateResp),EV_COMMAND(IDC_CALIBSAVEBUT,CalibSaveResp),EV_COMMAND(IDC_CALIBLOADBUT,CalibLoadResp),EV_COMMAND(IDC_CALIBRESTORE,CalibRestoreResp),EV_COMMAND(IDC_CALIBSETNUMMASSES,CalibSetNumMassesResp),EV_WM_DESTROY, // Ev_WM_Destroy END_RESPONSE_TABLE;

The line 线

EV_LVN_ENDLABELEDIT(IDC_CALIBMASSES, MassCol_EndLableEditResp)

gives the error 给出错误

[BCC32 Fehler] AcMode_TS_Dial.CPP(13): E2285 Keine Übereinstimmung für 'b_LV_DISPINFO_NOTIFY_Sig(void (TTSCalibDialog::*)(TLvDispInfoNotify &))' gefunden while the second argument is declared void MassCol_EndLableEditResp(TLwDispInfoNotify& nmHdr) [BCC32 Fehler] AcMode_TS_Dial.CPP(13):E2285 KeineÜbereinstimmungfür'b_LV_DISPINFO_NOTIFY_Sig(void(TTSCalibDialog :: *)(TLvDispInfoNotify&))gefunden,而第二个参数被声明为MassCsp_Notw(Disw)
{MassCol->EndLableEditResp(nmHdr);}; {MassCol-> EndLableEditResp(nmHdr);};

The first argument seems also legit to use here... 在这里使用第一个参数似乎也是合法的...

Later there is a line used 后来有一行

EV_LVN_ENDLABELEDIT(IDC_SIMWEIGHTCOL,AddCol0_EndLableEditResp), EV_LVN_ENDLABELEDIT(IDC_SIMWEIGHTCOL,AddCol0_EndLableEditResp),

with the same error, so I think there might be an include or namespace missing... 同样的错误,所以我认为可能缺少包含或名称空间...

Does anyone know this function or what could cause the error? 有谁知道此功能或什么可能导致错误?

After some time I asked in the OWLNext-Forum, too, recieving the right answer there: 一段时间后,我也在OWLNext-Forum中询问,在那里得到了正确的答案:

http://sourceforge.net/p/owlnext/discussion/97175/thread/a0cc4131/ http://sourceforge.net/p/owlnext/discussion/97175/thread/a0cc4131/

void TTSCalibDialog::MassCol_EndLableEditResp(TLwDispInfoNotify& nmHdr) 
{MassCol->EndLableEditResp(nmHdr);}

This function returns void, however, bool is required. 该函数返回void,但是必须使用bool。 Changing the type and returning true inside solved this issue. 更改类型并在内部返回true可以解决此问题。

There were a few other issues as well, but now the program is happily compiling on the XE2-Studio. 还存在其他一些问题,但是现在该程序可以在XE2-Studio上愉快地编译。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM