insidecom.java

来自「经验交流,从网上下载的好东西望大家分享」· Java 代码 · 共 30 行

JAVA
30
字号
/**
 * This class is designed to be packaged with a COM DLL output 
 * format. The class has no standard entry points other than the 
 * constructor. Public methods are exposed as methods on the 
 * default COM interface. 
 * @com.register ( clsid=DB379AA0-D639-11D2-BB51-006097B5EAFC, typelib=DB379AA1-D639-11D2-BB51-006097B5EAFC )
 */
import com.ms.com.*;

/**
 * @com.register ( clsid=2652CA66-D6CF-11D2-BB51-006097B5EAFC, typelib=2652CA65-D6CF-11D2-BB51-006097B5EAFC )
 */
public class InsideCOM implements component.ISum
{
    // TODO: Add additional methods and code here
    public int Sum(int x, int y)
    {
        if(x < 0 || y < 0)
            throw new ComFailException(0x80070057, 
                "Negative numbers not allowed");
        return x + y;
    }

    /**
     * NOTE: To add auto-registration code, refer to the 
     * documentation on the following method:
     *   public static void onCOMRegister(boolean unRegister) {}
     */
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?