(ref. I'm trying to build my own operator interface in C++)
When I get a reference to a SequenceFile object I have to release this object when I'm done.
But If I AddRef the SequenceFile object before releasing it a first call to the ReleaseSequenceFile method should not actually release it, should it, It should do the actual release when I call the function for the second time.
This is my understanding from the teststand activex help reference, however when trying this, it does not work...the sequence file gets released the first time ?
can anybody help me out, maybe I'm doing something wrong here.
here's my code:
tsSequenceFile1.AttachDispatch( m_Engine.GetSequenceFile(strSequenceFile, TS_GetSeqFile_OperatorInterfaceFlags), TRUE);
tsSequenceFile1.m_lpDispatch->AddRef();
tsSequenceFile2.AttachDispatch(tsSequenceFile1.m_lpDispatch, FALSE);
now releasing it twice...
m_Engine.ReleaseSequenceFile(tsSequenceFile1.m_lpDispatch);
// release sequence file
tsSequenceFile1.ReleaseDispatch();
m_Engine.ReleaseSequenceFile(tsSequenceFile2.m_lpDispatch);
// release sequence file
tsSequenceFile2.ReleaseDispatch();
The second releaseSequenceFile, gives me the error message that the specified
sequence file is already been unloaded by the engine.
regards