技术论坛

回复:请问WinCC.V5.1里如何在运行环境下设置打印时间

作者 主题
侠圣

经验值: 3120
发帖数: 2161
精华帖: 21
回复:请问WinCC.V5.1里如何在运行环境下设置打印时间


只看楼主 2005-09-15 11:18:33
1.ModifyPrintJob:

BOOL ModifyPrintJob(SYSTEMTIME st1,SYSTEMTIME st2,char jobname[200])
{
BOOL fRet;
PCMN_ERROR pError;
HPROPERTIES hProp;
LPVOID ptr1,ptr2;
DWORD typ;
DWORD dwVal;
char propname1[200],propname2[200];
TCHAR g_szProj[MAX_PATH+1];

typ = VT_DATE;
strcpy( propname1, "ABSOLUTESELECTIONFROM");
strcpy( propname2, "ABSOLUTESELECTIONTO");
ptr1 = (LPVOID)&st1;
ptr2 = (LPVOID)&st2;

//-----get project path
if( !DMGetRuntimeProject( g_szProj, MAX_PATH, pError))
{
printf("Error DMGetRuntimeProject(...)\r\n");
return FALSE;
}

//-----create property handle
hProp = RPJCreatePropertyHandle ( g_szProj, pError );
if( !hProp)
{
printf("Error RPJCreatePropertyHandle(...)\r\n");
return FALSE;
}

//-----get job properties
if ( !RPJGetJobProps ( hProp, jobname, pError ))
{
printf("Error RPJGetProps(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----set property
if ( !RPJSetProperty ( hProp, propname1, ptr1, (VARTYPE) typ, 200, pError ))
{
printf("Error RPJSetProperty(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----save job properties
if ( !RPJSetJobProps ( hProp, jobname, pError))
{
printf("Error RPJSetProps(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----get job properties
if ( !RPJGetJobProps ( hProp, jobname, pError ))
{
printf("Error RPJGetProps(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----set property
if ( !RPJSetProperty ( hProp, propname2, ptr2, (VARTYPE) typ, 200, pError ))
{
printf("Error RPJSetProperty(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----save job properties
if ( !RPJSetJobProps ( hProp, jobname, pError))
{
printf("Error RPJSetProps(...)\r\n");
RPJDeletePropertyHandle ( hProp, pError);
return FALSE;
}

//-----delete property handle
fRet = RPJDeletePropertyHandle ( hProp, pError);

return TRUE;

}

2.TimeFrom:

SYSTEMTIME TimeFrom()
{

static SYSTEMTIME st;

st.wYear = GetTagWord("Staryear");
st.wMonth = GetTagWord("Starmonth");
st.wDay = GetTagWord("Starday");
st.wHour = GetTagWord("Starhour");
st.wMinute = GetTagWord("Starminute");
st.wSecond = GetTagWord("Starsecond");

return st;

}

3.TimeTo:

SYSTEMTIME TimeTo()
{
static SYSTEMTIME st;

st.wYear = GetTagWord("ENDyear");
st.wMonth = GetTagWord("ENDmonth");
st.wDay = GetTagWord("ENDday");
st.wHour = GetTagWord("ENDhour");
st.wMinute = GetTagWord("ENDminute");
st.wSecond = GetTagWord("ENDsecond");

return st;

}
上面是主要的项目函数!
需要更详细资料请联系我!!!
雄关漫道真如铁,而今迈步从头越!
以下网友喜欢您的帖子:

  
重要声明:

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

帖子链接:https://www.ad.siemens.com.cn/club/bbs/post.aspx?a_id=167774&b_id=5&s_id=0&num=0

  • 上一页
  • 1
  • 下一页
收起
回复:请问WinCC.V5.1里如何在运行环境下设置打印时间
×
扫描打开手机版
您收到0封站内信:
×
×
信息提示
很抱歉!您所访问的页面不存在,或网址发生了变化,请稍后再试。