/*****************************************************************************/
// 函数名??ModifyPrintJob
// 功 能??修改打印作业的绝对时间
/*****************************************************************************/
BOOL ModifyPrintJob(SYSTEMTIME st1, SYSTEMTIME st2,charjobname【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;
if( !DMGetRuntimeProject( g_szProj, MAX_PATH, pError ) )
{
printf( "Error DMGetRuntimeProject(...)\r\n" );
return FALSE;
}
hProp = RPJCreatePropertyHandle( g_szProj, pError );
if( !hProp )
{
printf( "Error RPJCreatePropertyHandle(...)\r\n" );
return FALSE;
}
if( !RPJGetJobProps( hProp, jobname, pError ) )
{
printf( "Error RPJGetJobProps(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
if( !RPJSetProperty( hProp, propname1, ptr1, (VARTYPE)typ, 200, pError ) )
{
printf( "Error RPJSetProperty(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
if( !RPJSetJobProps( hProp, jobname, pError ) )
{
printf( "Error RPJSetJobProps(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
if( !RPJGetJobProps( hProp, jobname, pError ) )
{
printf( "Error RPJGetJobProps(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
if( !RPJSetProperty( hProp, propname2, ptr2, (VARTYPE)typ, 200, pError ) )
{
printf( "Error RPJSetProperty(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
if( !RPJSetJobProps( hProp, jobname, pError ) )
{
printf( "Error RPJSetProps(...)\r\n" );
RPJDeletePropertyHandle( hProp, pError );
return FALSE;
}
fRet = RPJDeletePropertyHandle( hProp, pError );
return TRUE;
}
/*****************************************************************************/
// 函数名??TimeFrom
// 功 能??打印时间的开始时间
/*****************************************************************************/
SYSTEMTIME TimeFrom()
{
SYSTEMTIME st;
st.wYear = GetTagWord("FromYear");
st.wMonth = GetTagWord("FromMonth");
st.wDay = GetTagWord("FromDay");
st.wHour = GetTagWord("FromHour");
st.wMinute = GetTagWord("FromMinute");
st.wSecond = GetTagWord("FromSecond");
return st ;
}
/*****************************************************************************/
// 函数名??TimeTo
// 功 能??打印时间的结束时间
/*****************************************************************************/
SYSTEMTIME TimeTo()
{
SYSTEMTIME st;
st.wYear = GetTagWord("ToYear");
st.wMonth = GetTagWord("ToMonth");
st.wDay = GetTagWord("ToDay");
st.wHour = GetTagWord("ToHour");
st.wMinute = GetTagWord("ToMinute");
st.wSecond = GetTagWord("ToSecond");
return st ;
}
这是程序已在项目函数中编译
遇到问题
选择当前数据和选择时间打印如何切换。
给打印连接C函数是如图
其中st1,st2,jobname分别代表什么。
新书描述不太清楚,可以交流