Появляется вот такая печенька "(null)SystemArchive\NS15/AI/OUM00CT001.VB_OUT" этот (null) очень мешает. Не знаю как избавится от него. Вот код на кнопку которая применяет настройки.
Код: Выделить всё
#include "apdefap.h"
void OnClick(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
char TrendTagName[_MAX_PATH] = "";
char ObjectName[_MAX_PATH] = "";
char ColorTagName[_MAX_PATH] = "";
char BeginTagName[_MAX_PATH] = "";
char EndTagName[_MAX_PATH] = "";
char VisibleTagName[_MAX_PATH] = "";
char* lpszTagname = NULL;
TCHAR *pszServer = NULL;
int i,j;
GetServerTagPrefix(&pszServer, NULL, NULL);
j=0;
for(i=1;i<=10;i++)
{
SetPropWord("Trends.Pdl","Control1","Index",i-1); //Return-Type: BOOL
//SetPropWord("Trends.Pdl","Control2","Index",i-1);
sprintf(ObjectName, "List%d",i);
sprintf(ColorTagName, "ColorTrend_%d",i);
sprintf(BeginTagName, "Begin_%d",i);
sprintf(EndTagName, "End_%d",i);
sprintf(VisibleTagName, "Visible_%d",i);
SetPropChar("Trends.Pdl","Control1","Name",GetPropChar("TrendSettings.PDL",ObjectName,"Text"));
SetPropWord("TrendSettings.PDL","List","ListIndex",GetPropWord("TrendSettings.PDL",ObjectName,"ListIndex"));
lpszTagname =GetPropChar("TrendSettings.PDL","List","Text");
sprintf(TrendTagName, "%sSystemArchive\\%s",pszServer,lpszTagname);
SetPropChar("Trends.Pdl","Control1","Tagname",TrendTagName);
SetPropWord("Trends.Pdl","Control1","Color",GetTagDWord(ColorTagName));
SetPropDouble("Trends.Pdl","Control1","BeginValue",GetTagDouble(BeginTagName));
SetPropDouble("Trends.Pdl","Control1","EndValue",GetTagDouble(EndTagName));
SetPropBOOL("Trends.Pdl","Control1","Autorange",0);
SetPropBOOL("Trends.Pdl","Control1","ItemVisible",GetTagBit(VisibleTagName));
SetPropWord("Trends.Pdl","Control1","TimeRangeFactor",(WORD)GetOutputValueDouble("TrendSettings.pdl","TimeRange"));
/*
SetPropChar("Trends.Pdl","Control2","Tagname",TrendTagName);
SetPropWord("Trends.Pdl","Control2","Color",GetTagDWord(ColorTagName));
SetPropDouble("Trends.Pdl","Control2","BeginValue",GetTagDouble(BeginTagName));
SetPropDouble("Trends.Pdl","Control2","EndValue",GetTagDouble(EndTagName));
SetPropBOOL("Trends.Pdl","Control2","Autorange",0);
SetPropBOOL("Trends.Pdl","Control2","ItemVisible",GetTagBit(VisibleTagName));
*/
if (GetTagBit(VisibleTagName))
j=j+1;
}
SetPropBOOL( "Trends.Pdl", "Control1", "Actualize", 1);
SetPropBOOL("Trends.Pdl","Control1","Activate", 0);
SetPropBOOL("Trends.Pdl","Control1","Activate", 1);
SetPropBOOL("Trends.Pdl","Control1","Online",TRUE);
//SetWidth("Trends.Pdl","Control1",j*29);
//SetWidth("Trends.Pdl","Control1",1600-j*29);
//SetLeft("Trends.Pdl","Control1",j*29);
SetHeight("Trends.Pdl","Control1",953-j*17);
TlgTrendWindowPressLinealButton("Trend");
TlgTrendWindowPressLinealButton("Trend");