vkrejc

Unregister PI points from event pipe in C++

Discussion created by vkrejc on Sep 26, 2012
Latest reply on Oct 2, 2012 by vkrejc

Hi,

 

I'm using event pipes for receiving new values from PI Server. Unfortunately I'm not able to unregister PI points from event pipe. Please review my code and let me know if I am doing something wrong. thank you!

 

I am receiving this error:  Microsoft C++ exception: std::__non_rtti_object at memory location 0x0400c1dc on the line with HRESULT _hr = raw_RemoveSignUp(vtPrimary, vtSecondary); from pisdk.tli.

 

Code:

 

 

 
PISDK::_PointListPtr l_removeList;
l_removeList.CreateInstance(__uuidof(PISDK::PointList));


for(std::list<_bstr_t>::const_iterator iter = _tagNames.begin(); iter != _tagNames.end(); ++iter)
{
     PISDK::PIPointPtr l_spPIPoint = m_spServer->PIPoints->GetItem(*iter);
                              
     l_removeList->Add(l_spPIPoint);
}

PISDK::IEventPipe3Ptr l_spIep3 = m_spEvPipe;

_variant_t l_values(l_removeList.GetInterfacePtr());
          
HRESULT l_hr = l_spIep3->RemoveSignUp(l_values, NULL);

 

 

 

 

 

Outcomes