SF 3377279

- Placed JacobVersion.properties into ${release.dir.java.meta.inf} instead of the current folder;
- com/jacob/test/safearray/SafeArrayBasicTest.java is compiled separately, because it is in UTF-16 encoding
- Added initializing Variant used to retrieve the next value from IEnum because some implemenations call VariantClear on it before setting a new value
- Changed _WIN32_WINNT to 0x0500 to fix build with VS2010
- Fixed the leak in Java_com_jacob_com_Variant_putVariantNoParam
- Added Dispatch.Method to the invoke flags to call _NewEnum. There are some nonconforming legacy implementations that expose _NewEnum as a method.
This commit is contained in:
clay_shooter
2011-10-01 22:33:38 +00:00
parent cbfc548c6f
commit 003671fb90
7 changed files with 108 additions and 27 deletions

View File

@@ -40,12 +40,13 @@ public class EnumVariant extends JacobObject implements
*/
public EnumVariant(Dispatch disp) {
int[] hres = new int[1];
// SF 3377279
// Added Dispatch.Method to the invoke flags to call _NewEnum. There are some
// non-conforming legacy implementations that expose _NewEnum as a method.
Variant evv = Dispatch.invokev(disp, DispatchIdentifier.DISPID_NEWENUM,
Dispatch.Get, new Variant[0], hres);
Dispatch.Get | Dispatch.Method, new Variant[0], hres);
if (evv.getvt() != Variant.VariantObject)
//
// The DISPID_NEWENUM did not result in a valid object
//
throw new ComFailException("Can't obtain EnumVARIANT");
EnumVariant tmp = evv.toEnumVariant();