12-13-2007 03:57 AM
if i delete: pExecution->Release(); The sequence editor works too:
That means the Editor is using this reference, too.
Please tell me where will this object bereleased?
Greetings from the lake of constance, Germany
juergen
12-13-2007 09:49 AM
It looks like you are using the TestStand API via a #import generated C++ wrapper. This is probably the best way to use any COM server in C++, but you need understand that the types that you use are C++ smart pointers. For example, the local variable of type "ExecutionPtr" is a C++ smart pointer class that will automatically release the reference it holds when it goes out of scope, which is a nice feature!. Thus, you shouldn't call Release directly, because then it will be called twice.
If you are curious, the implementation of the COM smart pointers for #import wrappers can ultimately be found in the _com_ptr_t class which is in your copy of Program Files\Microsoft Visual Studio 8\VC\Include\comip.h file.