This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
6 Replies Last post: Feb 10, 2010 10:10 PM by Peter Brown  
Adam T   19 posts since
Sep 1, 2009
Currently Being Moderated

Jan 26, 2010 10:32 PM

Parameter types or their count are not correct

I generated a wrapping for MS Excel 03.

 

In that, there is an _Chart class.  It has the following 3 methods. (the corresponding impl class has the same ones, they all call the came virtual method - 63).

 

    /**
     *
     */
    void copyPicture(
        XlPictureAppearance /*[in]*/ Appearance,
        XlCopyPictureFormat /*[in]*/ Format,
        XlPictureAppearance /*[in]*/ Size,
        Int32 /*[in]*/ lcid)
        throws ComException;

 

    /**
     *
     */
    void copyPicture(
        Variant[] /*[in]*/ optParams0,
        Int32 /*[in]*/ lcid)
        throws ComException;

 

    /**
     *
     */
    void copyPicture(
        Int32 /*[in]*/ lcid)
        throws ComException;

 

The MSDN docs are here: http://msdn.microsoft.com/en-us/library/aa223846%28office.11%29.aspx

 

The interesting part is the last param required in all of the above calls isn't included in the MSDN docs.

 

When I try to execute:

_chart.copyPicture(new Int32(0));

 

I get:

Caused by: com.jniwrapper.FunctionExecutionException: Parameter types or their count are not correct
        at com.jniwrapper.Function.invokeVirtualFunc(Native Method)
        at com.jniwrapper.FunctionCall.a(SourceFile:131)
        at com.jniwrapper.FunctionCall.callVirtual(SourceFile:58)
        at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeVirtualMethod(SourceFile:661)
        at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:740)
        at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:723)
        at generated.excel8.excel.impl._ChartImpl.copyPicture(_ChartImpl.java:1270)

 

Now there are competing types here, _Chart and ChartObject.  What is the difference between the two?  I noticed in the implementations that the _Chart object uses invokeStandardVirtualMethod and the ChartObject uses Automation.invokeDispatch.  Should I be sticking to the one over the other?  What is the major difference?

 

ChartObject has the same 3 methods, but they have the following signatures

_Chart

public static final String INTERFACE_IDENTIFIER = "{000208D6-0000-0000-C000-000000000046}";

 

ChartObject

public static final String INTERFACE_IDENTIFIER = "{000208CF-0000-0000-C000-000000000046}";

 

    /**
     *
     */
    Variant copyPicture(
        XlPictureAppearance /*[in]*/ Appearance,
        XlCopyPictureFormat /*[in]*/ Format);

 

    /**
     *
     */
    Variant copyPicture(
        Variant[] /*[in]*/ optParams0);

 

    /**
     *
     */
    Variant copyPicture();

 

I also found the following for your other package.  http://support.teamdev.com/message/9433#9433  Should I just use export instead?

 

Any help would be appreciated.

Thanks,

Adam.

Yuriy Privezentsev TeamDev Ltd. 78 posts since
Jan 19, 2010
Currently Being Moderated
2. Jan 28, 2010 8:09 PM in response to: Adam T
Re: Parameter types or their count are not correct

Hello Adam,

Thank you for providing us with the detailed information. We have investigated the issue and found that the problem is with stubs generated for methods with optional parameters different from Variant type. We are working at the issue now and hopefully will come up with the solution by the end of the next week. We will provide you with the updated version of the code generator as soon as this problem is fixed.



Regards,

Yuriy.

Yuriy Privezentsev TeamDev Ltd. 78 posts since
Jan 19, 2010
Currently Being Moderated
3. Feb 8, 2010 9:10 PM in response to: Adam T
Re: Parameter types or their count are not correct

Adam,

you can download hot fix for this problem by this link: ftp://ftp.teamdev.com/updates/comfyj-generator-2.7.22850.jar

Please try this update and let us know the results.

Regards,

Yuriy.



Peter Brown   14 posts since
Jan 18, 2010
Currently Being Moderated
4. Feb 9, 2010 3:57 PM in response to: Yuriy Privezentsev
Re: Parameter types or their count are not correct

I've also encountered this problem with wrappers generated by comfyj for powerpoint 2003.

I've tried applying the fix that you suggested and now get the following error from CodeGenForComfyJ:

 

 

[checking com.onedrum.windows.powerpoint.stub.powerpoint.impl.SequenceImpl]

[loading java\lang\Number.class(java\lang:Number.class)]

Z:\windowsSoftware\tmp\ppt\com\onedrum\windows\powerpoint\stub\powerpoint\impl\SequenceImpl.java:286: cannot find symbol

symbol  : constructor MsoRGBType(int)

location: class com.onedrum.windows.powerpoint.stub.office.MsoRGBType

                optParams2 != null && optParams2.length > 0 ? (Parameter)optParams2[0] : new MsoRGBType(0),

                                                                                         ^

Z:\windowsSoftware\tmp\ppt\com\onedrum\windows\powerpoint\stub\powerpoint\impl\SequenceImpl.java:309: cannot find symbol

symbol  : constructor MsoRGBType(int)

location: class com.onedrum.windows.powerpoint.stub.office.MsoRGBType

                new MsoRGBType(0),

                ^



 

This results in several impl classes that I'm trying to use being missing (ShapesImpl, TextFrameImpl, TextRangeImpl).

Yuriy Privezentsev TeamDev Ltd. 78 posts since
Jan 19, 2010
Currently Being Moderated
5. Feb 10, 2010 7:04 PM in response to: Peter Brown
Re: Parameter types or their count are not correct

Peter,

Thank you for pointing out this issue. We have fixed it. You can download the hot fix by the following link ftp://ftp.teamdev.com/updates/comfyj-generator-2.7.22873.jar

Please try it and let us know if you have any further problems with it.

Regards,

Yuriy.

Peter Brown   14 posts since
Jan 18, 2010
Currently Being Moderated
6. Feb 10, 2010 10:10 PM in response to: Yuriy Privezentsev
Re: Parameter types or their count are not correct

Hi Yuriy,

 

I've given the latest hotfix a quick try and it does fix both the code generation and parameter problem.

 

Cheers

 

Peter.

More Like This

  • Retrieving data ...