![]() |
How to release ISldWorks via OLE automation?
ow to release ISldWorks via OLE automation?
It maybe has some problems when I close the SolidWorks session via the following code. My code as follows: // code 2 start ISldWorks m_pSldWorks; // connects to an already running instance of SW //????????????? // or will start SW if not already running m_pSldWorks.CreateDispatch(_T("SldWorks.Application")); //??????? // close the SolidWorks session m_pSldWorks.ExitApp (); m_pSldWorks.DetachDispatch(); m_pSldWorks.ReleaseDispatch(); m_pSldWorks.m_lpDispatch = NULL; |
回复: How to release ISldWorks via OLE automation?
Hello Yanhua,
You should be able to simply use the ReleaseDispatch call when you are done with it. A call to ExitApp is required beforehand if you are looking to close SW. Stepping into ReleaseDispatch should show you what it is doing. Regards, Earl Hasz |
所有的时间均为北京时间。 现在的时间是 02:43 PM. |