📄 javasink.java
字号:
// Click Project | Add COM Wrapper
// Select Inside COM+ Component Type Library and click OK
// Then build this Java project
import component.*;
import com.ms.com.ConnectionPointCookie;
public class JavaSink implements IOutGoing
{
public void GotMessage(int Message)
{
System.out.println((char)Message);
}
}
class Driver
{
public static void main(String[] args)
{
ISum ref = (ISum)new component.InsideCOM();
System.out.println("8 + 9 = " + ref.Sum(8, 9));
try
{
JavaSink j = new JavaSink();
ConnectionPointCookie EventCookie = new
ConnectionPointCookie(ref, j,
Class.forName("component.IOutGoing"));
System.out.println("Press Enter to exit.");
System.in.read();
}
catch(Exception e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -