几何尺寸与公差论坛

 找回密码
 注册
查看: 2926|回复: 1

Which functions of ISldWorks should I use to catch the error?

[复制链接]
发表于 2007-5-24 11:22:10 | 显示全部楼层 |阅读模式
Q:RE: Which functions of ISldWorks should I use to catch the error when the relative USB dongle is removed? [SR-1-348618481]
Hi Frank,

Question: Which functions of ISldWorks should I use to catch the error of security device or the status of SW locked when the relative USB dongle is removed?

For customer or user, when the relative USB dongle is removed, SW only pushes an error dialog of security device and is locked. Then, SW is closed when user click OK button in the error dialog.

However, for API developer, ISldWorks still has original value when the relative USB dongle is removed. I need catch the error of security device (before SW is closed), do other things (For example, SW_DCT converter will replace   SW_DCI converter).

First of all, I introduce my development information (data exchange between SW and PC-DIMS) about PC-DIMS software which is measurement software for geometrical product.

In PC-DIMS software, there are SW_DCI (directly read SW data or information into PC-DIMS through SW_API as well SW is installed) and SW_DCT (SW format file convert PC-DIMS format file as well SW is not installed) interfaces. I’m in charge of SW_DCI. When SW_DCI begin to work or convert, I need catch the status of SW_dongle. My goal is that SW_DCI will be changed to SW_DCT, if SW is disabled.

Best wishes,
yogy
 楼主| 发表于 2007-5-24 11:23:35 | 显示全部楼层

回复: Which functions of ISldWorks should I use to catch the error?

R:

Hello,

Earlier I wrote:


> As a result SolidWorks will close down. As part of the shutdown it will unload add-ins.


If your SW_DCI application is a COM-based add-in, the:


    ISwAddin:isconnectFromSW



method will be the right place to notify your PC-DIMS software that SolidWorks is no longer available.

This method will be called when SolidWorks unloads an add-in.



Another solution that comes to mind is using Win32 API functions to obtain the process handle for sldworks.exe and use WaitForSingleObject to wait in a separate thread for the SolidWorks process to terminate. However, this is outside the scope of the SolidWorks API.


Regards,


    Frank
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|几何尺寸与公差论坛

GMT+8, 2024-12-23 00:21 , Processed in 0.036703 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表