You need to use IBody2::Operations2. Note that after you use this method, the IBody2 pointers are lost so if you need to re-use those bodies then use IBody2::Copy before using IBody2::Operations2.
More details on that error can be found on page 19 of the PDF here. (The PDF is free but requires a free membership at my web site before you can access it.)
For the boolean operations on the temporary bodies you need to use the following method: Body2::Operations2.
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
myIntercad – an integrated tool for SolidWorks Professionals