[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ms-java-com
Subject:    Re: IDispatch(Ex) and Struct limitations
From:       Igor Kats <igork () SKYHIGH ! CO ! IL>
Date:       1999-01-31 12:13:29
[Download RAW message or body]


This question needs to be readdressed to Chad.
I declare DISPPARAMS structure in:

public final class DISPPARAMS
{
   /** @com.structmap([offset=0, type=U4] rgvarg) */
   public int rgvarg;

   /** @com.structmap([offset=4, type=U4] rgdispidNamedArgs) */
  public int rgdispidNamedArgs;

  /** @com.structmap([offset=8,type=U4] cArgs) */
  public int cArgs;

  /** @com.structmap([offset=12,type=U4] cNamedArgs) */
  public int cNamedArgs;

}

In Invoke method do:
Variant param = (Variant)ComLib.ptrToStruct(Variant.class ,
pDispParams.rgvarg)

param receive valid value and vt type for last parameters(PASCAL call
convert), it is not ARRAY of pointers.
I think that DispGetParam falls on this.

Igor
igork@skyhigh.co.il

-----Original Message-----
From: Java and COM [mailto:Java-COM@DISCUSS.MICROSOFT.COM]On Behalf Of Jamie
Thomas
Sent: Saturday, January 30, 1999 1:37 AM
To: Java-COM@DISCUSS.MICROSOFT.COM
Subject: IDispatch(Ex) and Struct limitations

With the help of Igor Kats, I've been marching down the path of overriding
the MSJVM's implementation of IDispatchEx.

I got it to work, or at least demonstrated that it could work, by
implementing a single dynamic method which I successfully called from ASP.
However, I stumbled across a couple of problems.

1.  I want to add a few dynamic methods and properties to an existing
component.  However, by overriding IDispatchEx, I appear to have interrupted
the VM's implementation of AutoIDispatch.  Do I have to explicitly call the
permanent members of the component from within InvokeEx, or can I trick the
VM into supporting all of the methods that are part of the compiled
component?

2.  How do I support methods with parameters?  Igor was kind enough to send
me the framework to override IDispatchEx, but the InvokeEx method receives a
DISPPARAMS structure that apparantly cannot be mapped by the VM because it
contains pointers to an array of parameter values.  The structure
declaration Igor sent me follows:

    public final class DISPPARAMS
    {
    // UNMAPPABLE: rgvarg: Cannot be used as a structure field.
    //   /** @com.structmap(UNMAPPABLE rgvarg) */
    //  public UNMAPPABLE rgvarg;

    // UNMAPPABLE: rgdispidNamedArgs: Cannot be used as a structure field.
    //   /** @com.structmap(UNMAPPABLE rgdispidNamedArgs) */
    //  public UNMAPPABLE rgdispidNamedArgs;

      /** @com.structmap([offset=8,type=U4] cArgs) */
      public int cArgs;

      /** @com.structmap([offset=12,type=U4] cNamedArgs) */
      public int cNamedArgs;
    }

As the comments show, the two pointers, rgvarg and rgdispidNamedArgs, could
not be mapped.  Has anyone successfully overriden the implementation of
IDispatch(Ex).Invoke(Ex) when parameters were involved?  I'm really excited
about the prospects of this functionality, but it's all really new to me
right now.  I've been sheltered in the world of Java and VB and the
intrusion of these COM/C++ concepts is difficult.

Any help is appreciated,

        Jamie

----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

----------------------------------------------------------------
Users Guide http://www.microsoft.com/workshop/essentials/mail.asp
contains important info including how to unsubscribe.  Save time, search
the archives at http://discuss.microsoft.com/archives/index.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic