0 Replies Latest reply on Feb 4, 2014 10:12 PM by Stephen Forrest

    Issue with IEquationMgr::put_Equation

    Stephen Forrest

      We've recently upgraded to SolidWorks 2014 and some existing code utilizing the C++ API is suddenly failing.


      In particular it is code using the put_Equation method from IEquationMgr; the corresponding get_Equation call works fine.  The code looks like:


         CComPtr<IEquationMgr> eqMgr = NULL;

         HRESULT hr = swModel->GetEquationMgr( &eqMgr );


         // ...

         hr = eqMgr->put_Equation( index, eqn );


      where index is of type long and eqn is a BSTR string.  The contents of eqn are ""foo"=2" (excluding the outer quotes of course).


      I'm confident this particular equation already exists among the set of equations beforehand.  I check that the index is valid and none of the HRESULT return values suggest anything is wrong.


      Given the symptoms I'm inclined to suspect the eqn argument.  What, if any, are the requirements on this argument, e.g. does it need to be terminated in some way or quoted differently?  Any insights would be most welcome.