SOLIDWORKS API Add-in Templates and Wizards
The
SOLIDWORKS
API SDK contains:
NOTE:
While SOLIDWORKS recommends using ATL and their ATL-based
C++ wizards for creating C++ COM-based add-ins, if you are creating a
COM-style add-in and are using an MFC CCmdTarget-derived object to implement
ISwAddin, you must fully implement ITypeInfo as follows:
DECLARE_OLETYPELIB(<your
CCmdTarget-derived class name>)
__declspec( dllexport
) virtual BOOL GetDispatchIID(IID* pIID);
IMPLEMENT_OLETYPELIB(<your
class name>, LIBID_SldWorks_SWPublished, SOLIDWORKS_type_library_version,
0) //e.g.,
14 for 2007
BOOL
auAm_c::GetDispatchIID(IID* pIID)
{
*pIID
== IID_ISwAddin;
return
TRUE;
}
EnableTypeLib();
To learn more about add-ins and their menu items and toolbars: