WinCC&ActiveX
Lidiya; 18.4.03
Как в WinCC вызывать методы ActiveX компоненты?
Re: WinCC&ActiveX
Лев
Шерешевский; 18.4.03
Примерно так:
#define GetObject GetObject
__object* pPDLRT = NULL;
__object* pPicture = NULL;
__object* pObject = NULL;
pPDLRT = __object_create("PDLRuntime");
printf("pPDLRT %x\r\n", pPDLRT);
if ( pPDLRT )
{
pPicture = pPDLRT->GetPicture(""); // "": stands for the current
picture
pPicture = pPDLRT->GetPicture(lpszPictureName);
// If the OCX is contained in another
// picture, then you have to fill in
// the name of that picture.
if( pPicture )
{
pObject = pPicture->GetObject("Control1"); // The name you gave
the OCX within WinCC
if(pObject)
{
if (pObject->Visible)
{
pObject->Enable(1); // 1: enable operation
// 0: disable operation
}
__object_delete(pObject);
}
__object_delete(pPicture);
}
__object_delete(pPDLRT);
}