// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;

public class C2 {
    public static void main(String[] args) {
        ActiveXComponent snat = new ActiveXComponent("COM.SNat");
        int a = 123;
        int b = 456;
        int c = snat.invoke("Add", new Variant(a), new Variant(b)).getInt();
        System.out.println(c);
        String s = "ABC";
        String s2 = snat.invoke("Dup", new Variant(s)).getString();
        System.out.println(s2);
        snat.setProperty("Iv", 123);
        snat.setProperty("Sv", "ABC");
        snat.invoke("M");
        int iv = snat.getPropertyAsInt("Iv");
        String sv = snat.getPropertyAsString("Sv");
        System.out.println(iv + " " + sv);
    }
}
