Introduction to COM – Step 11 of 12

11. Inside the Sum definition, add this code:




*pRes = x + y;

return hr;


over the existing dummy "return S_OK" statement. This code makes no attempt to check input parameters and is very crude. Remember that because COM methods return HRESULT values for error-checking, we must store our sum into a pointer (*pRes). I used pRes to stand for "pointer to result".

Next: Step 12 of 12

Start: Step 0 of 12


This entry was posted in Software Test Automation. Bookmark the permalink.