0 Replies Latest reply on Jun 20, 2015 3:39 AM by Joshua Jiang

    How to use HoleWizard method to create holes in Standalone Application?

    Joshua Jiang

      I use C++ to develop in the VS2010 environment.


      According to the API Help,  Holes can be created in the following codes.



             hr = swFeatMgr->HoleWizard4(swWzdTap, swStandardGB, swStandardGBTappedHole, L"M8", swEndCondBlind,

             0.0068, 0.02225, 0.016, 0, 0, 0, 0, 2.05948851735331, 1, 0, 0, 0, -1, -1, L"",



      In the project created by AddinWizard, the code works properly. But in the StandAlone Application the 'hr'variant always returns false(the dot preselected correctly). The code under always returns false,too. I don't know why >_<

           CComPtr<IDispatch> holeDispatch;

           hr = swFeatMgr->CreateDefinition(swFmHoleWzd,&holeDispatch);


      I get access to the SW with following codes as told in the API HELP:


           CComPtr<ISldWorks> swApp;

           HRESULT hres = swApp.CoCreateInstance(__uuidof(SldWorks), NULL, CLSCTX_LOCAL_SERVER);


      So anyone knows what mistakes I have made? Thank you all in advance!

      By the way, It seems C++ is rarely used in developing SW.  Comparing to C# and VB, C++ is in disadvantage?