2963102 |
Convert API to use var args and remove the many overloaded Dispatch
diff --git a/jacob/samples/com/jacob/samples/applet/AppTest.java b/jacob/samples/com/jacob/samples/applet/AppTest.java
deleted file mode 100644
index ca9cc82..0000000
--- a/jacob/samples/com/jacob/samples/applet/AppTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package com.jacob.samples.applet;
-
-import java.applet.Applet;
-import java.awt.Button;
-import java.awt.FlowLayout;
-import java.awt.TextField;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import com.jacob.activeX.ActiveXComponent;
-import com.jacob.com.Dispatch;
-import com.jacob.com.Variant;
-
-/**
- * Applet test case
- */
-public class AppTest extends Applet implements ActionListener {
- /**
- * unique identifier added by Eclipse because this class is serializable
- */
- private static final long serialVersionUID = -6676420357823607065L;
-
- TextField in;
-
- TextField out;
-
- Button calc;
-
- ActiveXComponent sC = null;
-
- /**
- * startup method
- */
- public void init() {
- setLayout(new FlowLayout());
- add(in = new TextField("1+1", 16));
- add(out = new TextField("?", 16));
- add(calc = new Button("Calculate"));
- calc.addActionListener(this);
-
- }
-
- /**
- * action method that receives button actions
- *
- * @param ev
- * the event
- */
- public void actionPerformed(ActionEvent ev) {
- if (sC == null) {
- String lang = "VBScript";
- sC = new ActiveXComponent("ScriptControl");
- Dispatch.put(sC, "Language", lang);
- }
- Variant v = Dispatch.call(sC, "Eval", in.getText());
- out.setText(v.toString());
- }
-}
diff --git a/jacob/samples/com/jacob/samples/applet/Applet.html b/jacob/samples/com/jacob/samples/applet/Applet.html
new file mode 100644
index 0000000..0c2f6b2
--- /dev/null
+++ b/jacob/samples/com/jacob/samples/applet/Applet.html
@@ -0,0 +1,20 @@
+
+
+ Jacob Test Applet
+
+
+
+
+
diff --git a/jacob/samples/com/jacob/samples/applet/Applet.jnlp b/jacob/samples/com/jacob/samples/applet/Applet.jnlp
new file mode 100644
index 0000000..9b25bef
--- /dev/null
+++ b/jacob/samples/com/jacob/samples/applet/Applet.jnlp
@@ -0,0 +1,27 @@
+
+
+
+
+ Jacob Test Applet
+ ttreeck, nepatec GmbH & Co. KG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/jacob/samples/com/jacob/samples/applet/JacobTestApplet.java b/jacob/samples/com/jacob/samples/applet/JacobTestApplet.java
new file mode 100644
index 0000000..6e7b4d3
--- /dev/null
+++ b/jacob/samples/com/jacob/samples/applet/JacobTestApplet.java
@@ -0,0 +1,88 @@
+package com.jacob.samples.applet;
+
+import java.applet.Applet;
+import java.awt.Button;
+import java.awt.FlowLayout;
+import java.awt.TextField;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import com.jacob.activeX.ActiveXComponent;
+import com.jacob.com.Dispatch;
+import com.jacob.com.Variant;
+
+/**
+ * Example applet to demonstrate:
+ * 1. The use of jacob from an applet
+ * 2. To show how to distribute the jacob native lib with the applet (also works with webstart)
+ *
+ * Comment on 2.:
+ * The way shown here is quite straight forward and it is not necessary to use
+ * a mechanism like the "DLLFromJARClassLoader" or something similar...
+ *
+ * @author ttreeck, www.nepatec.de
+ *
+ */
+
+public class JacobTestApplet extends Applet implements ActionListener {
+
+ private static final long serialVersionUID = 4492492907986849158L;
+
+ TextField in;
+ TextField out;
+ Button calc;
+ ActiveXComponent sC = null;
+
+ /**
+ * startup method
+ */
+ @Override
+ public void init() {
+ setLayout(new FlowLayout());
+ add(this.in = new TextField("1+1", 16));
+ add(this.out = new TextField("?", 16));
+ add(this.calc = new Button("Calculate"));
+ this.calc.addActionListener(this);
+
+ }
+
+ /**
+ * Returns information about this applet.
+ * According to the java spec:
+ * "An applet should override this method to return a String containing information about the author, version, and copyright of the applet."
+ *
+ * @return information about the applet.
+ */
+ @Override
+ public String getAppletInfo() {
+ return "Jacob Test Applet. Written by ttreeck, nepatec GmbH & Co. KG.\nhttp://www.nepatec.de";
+ }
+
+ /**
+ * Returns information about the parameters that are understood by this applet.
+ * According to the java spec:
+ * "An applet should override this method to return an array of Strings describing these parameters."
+ *
+ * @return array with a set of three Strings containing the name, the type, and a description.
+ */
+
+ @Override
+ public String[][] getParameterInfo(){
+ return new String[][]{};
+ }
+
+ /**
+ * action method that receives button actions
+ *
+ * @param ev the event
+ */
+ public void actionPerformed(ActionEvent ev) {
+ if (this.sC == null) {
+ String lang = "VBScript";
+ this.sC = new ActiveXComponent("ScriptControl");
+ Dispatch.put(this.sC, "Language", lang);
+ }
+ Variant v = Dispatch.call(this.sC, "Eval", this.in.getText());
+ this.out.setText(v.toString());
+ }
+}
\ No newline at end of file
diff --git a/jacob/samples/com/jacob/samples/applet/Readme.txt b/jacob/samples/com/jacob/samples/applet/Readme.txt
new file mode 100644
index 0000000..2347c72
--- /dev/null
+++ b/jacob/samples/com/jacob/samples/applet/Readme.txt
@@ -0,0 +1,59 @@
+There is an easy and elegant way to load DLLs from Applets and JavaWebStart Applications.
+
+Both JavaWebStart and Applets support JNLP (Applets since 1.6.0_10 aka plugin2).
+Within a jnlp file it is possible to specify a nativelib and that's it!
+So what do you need to do?
+
+1.) package the jacob-1.XX-xXX.dll into a jar file (root level of the jar, not into a subfolder) and put it into your applications lib folder next to your other libs (e.g. jacob.jar)
+2.) Specify all your libraries in your jnlp file like this:
+
+
+
+
+
+ My cool Application or Applet
+ nepatec GmbH & Co. KG
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ some crazy arguments
+
+
+
+3.) Sign all the jars or set up a policy file (cp. Applet Security below)
+4.) Deploy your application and start it via webstart or as an applet (from an webpage)
+
+
+General comments:
+
+- If you sign the jar files you need the tag - when using a policy file it can be removed
+- furthermore it is recommended that all libs are signed with an official certificate (e.g. from verisign, thawte etc) so that the browser doesn't pop a warning stating 'untrusted' application...
+- to check the validity of your jnlp file the tool JaNeLA (link cp. sources below) is recommended.
+
+[Sources]
+New Applet: https://jdk6.dev.java.net/plugin2/
+Applet JNLP: https://jdk6.dev.java.net/plugin2/jnlp/
+Applet Security: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/appA.html
+JNLP API: http://www.oracle.com/technetwork/java/javase/index-141367.html
+JNLP Verifier: http://pscode.org/janela/
\ No newline at end of file
diff --git a/jacob/unittest/com/jacob/test/safearray/SafeArrayBasicTest.java b/jacob/unittest/com/jacob/test/safearray/SafeArrayBasicTest.java
index a41f220efbdb641ea6978ffa75affcf01da080be..df04e4d52a23303553151f3fb34bc3a0062d9bf1 100644
GIT binary patch
delta 2070
zcmcgtT})GF82&2KQrlypLwa05+5+YDi1b(*9BnC-T8gGWL|}1q$(X{BEGQ6{sf%RU
z92;AvbPtO`Oq7`H=faqHXN>#FZgz)WZ^mi1t7XY{vFyrq?{|Jmlyw2KEGIpEzw^D{
z`@YZn^L(E#n{He(&8JL4KHWvH`FK7r=N~yyW$LpEEWl)X1ROQBS==PKN&eKdgv6#^
zL0d=JB#Y74i<^Kz*%jO^6CJuHY0G3mz+Yv@>jh>ttdV4BXcE_%uWi81%|1NXJd7#-
z`z8T*%7@TwoID$xpkMw?Q-&xN0#&M@>4^}F=^%JK_
zHp8~XZqZM2P2{$mqy2-Zx7(4hxyiDEPizNpPiUua;$ynU?F*{zb^BJlCUD&}`TIc_
z+hxR}N3;%X%UiuFf^l|?oq!VXBbTm(#S!9Yaksn?zc^ZoI9|Y?6{3N>7?Xk9ir%~_$@p3NplGpP4q-^1E!lq)
zEwVOuC^aDim}?cEB9cODBboxM*iuR>-cYDVH4a!)t#^VO>&HS+g1_x!9jOl!AqAI1
zZ
zjyzruM=6IIS8{uN=8ct`CD}>RA7w|_33`vPF!kS0;ec*8N^D!Srk^u-wh**qG$LY3
zti@8~ApVFf;KOJyEXfuWqG3cj2bW)eOoI2?rb%pS4
zm(ff6;fO!0vx^yH@!H2KdM$n!RXxu?^AFsHvptK%pT>>CZ;MQ#9q%Sy#Dl~z_b1lj
z$lldReoNF@jB1&ahX|7bBnPR|H7F#HV!U?{U-gb)cb|fxR1kBiLEKOE(|Xv(bFDoR
z$PR9i&aZth(S8kH*%$to+J3q3)S4)rIJKYOQ)d&0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