diff --git a/docs/ReleaseNotes.html b/docs/ReleaseNotes.html index ddda89b..6c0511d 100644 --- a/docs/ReleaseNotes.html +++ b/docs/ReleaseNotes.html @@ -7,6 +7,7 @@ Variants @@ -20,6 +21,10 @@ 1474474 Static constants in the Variant class can no longer have SafeRelease() called on them. + + 1477793 + obj2variant should accept java.util.Date the same way the Variant constructor does +     diff --git a/src/com/jacob/com/Dispatch.java b/src/com/jacob/com/Dispatch.java index bc1bba2..75634e5 100644 --- a/src/com/jacob/com/Dispatch.java +++ b/src/com/jacob/com/Dispatch.java @@ -20,6 +20,7 @@ package com.jacob.com; import java.lang.reflect.Array; +import java.util.Date; /** * Object represents MS level dispatch object. @@ -328,6 +329,7 @@ public class Dispatch extends JacobObject || objectToBeMadeIntoVariant instanceof Double || objectToBeMadeIntoVariant instanceof Float || objectToBeMadeIntoVariant instanceof SafeArray + || objectToBeMadeIntoVariant instanceof Date || objectToBeMadeIntoVariant instanceof Dispatch) return new Variant(objectToBeMadeIntoVariant); diff --git a/unittest/com/jacob/com/DispatchTest.java b/unittest/com/jacob/com/DispatchTest.java new file mode 100644 index 0000000..434e6a1 --- /dev/null +++ b/unittest/com/jacob/com/DispatchTest.java @@ -0,0 +1,28 @@ +package com.jacob.com; + +import java.util.Date; + +/** + * Test some of the Dispatch utility methods + * -Djava.library.path=d:/jacob/release -Dcom.jacob.autogc=true -Dcom.jacob.debug=false + * @author joe + + * @author joe + * + */ +public class DispatchTest { + + public static void main(String[] args) + { + Date testDate = new Date(); + Variant fromDate = Dispatch.obj2variant(testDate); + Date returnedDate = fromDate.getJavaDate(); + System.out.println("test date is "+testDate); + System.out.println("VariantDate is "+fromDate.getJavaDate()); + if (testDate.equals(returnedDate)){ + + } else { + System.out.println("Could not call obj2variant(Date) and get it to work"); + } + } +}