А можно примерчик типа "Hello, world!" ?
Пример писал без проверки. Возможны ошибки синтаксиса, но смысл думаю понятен.
LPCalcReportVar OldOnCalcReportVar;
int MyReportVar1, MyReportVar2;
double MyCalcReportVar(int ReportVarID, int IndexFrom, int IndexTo, char* &ValueS);
void PluginInitEventHandler()
{
//*CraiD: При совпадение имён, предыдущая переменная перезаписывается новой.
MyReportVar1 = EventHandler->PluginReportFunction->AddReportVar("PluginVar","Это переменная из плагина");
MyReportVar2 = EventHandler->PluginReportFunction->AddReportVar("PluginVar2","Это тоже переменная из плагина");
OldOnCalcReportVar = EventHandler->PluginReportFunction->OnCalcReportVar;
EventHandler->PluginReportFunction->OnCalcReportVar = MyCalcReportVar;
}
double MyCalcReportVar(int ReportVarID, int IndexFrom, int IndexTo, char* &ValueS)
{
if (ReportVarID == MyReportVar1){
return IndexFrom;
} else if (ReportVarID == MyReportVar2){
ValueS = EventHandler->UtilFunction->GetMemory(100);
strcpy(ValueS,"!!!!!!!!");
return 0;
} else if (OldOnCalcReportVar) return OldOnCalcReportVar(ReportVarID, IndexFrom, IndexTo,ValueS);
return 0;
}