about IInsertCombineFeature funtion

Dear All,

I just started working with Solidworks API last week using C++. I have a problem about IInsertCombineFeature function. Hopefully, someone could help me.

I inserted two parts (solid bodies) into one part document and mated them. Then I selected these two solid bodies and want to call IInsertCombineFeature function to subtract one from the other. But It fails. Can anybody help?

Many thanksSolidworksWeldments