From af9b86f6d468b0467bb0ada04865480549a3651d Mon Sep 17 00:00:00 2001 From: GUILHERME THEILACKER <168378312+ySKELLETONX@users.noreply.github.com> Date: Mon, 29 Dec 2025 23:15:58 -0300 Subject: [PATCH] Throw exception if COM dm.dmsoft is not found Added error handling for COM object initialization. --- damo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/damo.cs b/damo.cs index eb17a4f..0b47f45 100644 --- a/damo.cs +++ b/damo.cs @@ -10,10 +10,16 @@ public class Damo public Damo() { obj = Type.GetTypeFromProgID("dm.dmsoft"); + + if (obj == null) + throw new InvalidOperationException( + "COM dm.dmsoft not found. Please verify that it is registered and that the project is set to x86.\"\r\n" + ); + obj_object = Activator.CreateInstance(obj); } - // 调用此接口进行com对象释放 + // 璋冪敤姝ゆ帴鍙h繘琛宑om瀵硅薄閲婃斁 public void ReleaseObj() { if (obj_object != null)