ActiveX followup message

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ActiveX followup message

Scott
Original message thread.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=9nlc72%248dls7%241%40ID-50941.news.dfncis.de&rnum=9

Using the custom callback mechnicism in HomeSeer, I have to create an
callback object to pass to HomeSeer that responds to HSEvent.  My IDL
is listed in this message.

The problem I have is that when HSEvent is invoke in dolphin, the
argument "parms" is an invalid Variant.  Registering the callback
object works just fine and the HSEvent method gets called in
Smalltalk.

The main issue (I believe) is in the the server side (VB SOURCE CODE)
that calls the HSEvent.  It is implemented in VB as follows.  I have
defined in my IDL (client side) that "P" is a VARIANT.  My question is
what is the right type of the argument "P" being passed?  Can I even
make this work as stated in dolphin?

Any help would be greatly appreciated.
Thanks,
Scott
[hidden email]

---------------IDL FILE----------------
[
  uuid(EC366884-7D7F-431C-BA7A-CF2F13FF1686),
  version(1.0)
]
library Temp
{
    importlib("stdole2.tlb");

    // Forward declare all types defined in this typelib
    interface _Application;

    [
      odl,
      uuid(81DA5F54-BED0-454C-BEF3-1700444AC484),
      version(1.0),
      hidden,
      dual,
      nonextensible,
      oleautomation
    ]
    interface _Application : IDispatch {
        [id(0x60030000)]
        HRESULT HsEvent([in] Variant[] parms);
    };

    [
      uuid(3835A8A8-FB31-4024-8677-9D549BA005FA),
      version(1.0)
    ]
    coclass Application {
        [default] interface _Application;
    };
};


------------VB SOURCE CODE------------
Sub WriteLog ( message as String)
    Dim P(5) As Variant
    P(0) = "0"
    P(1) = "1"
    P(2) = "2"
    P(3) = "3"
    P(4) = "4"
    P(5) = "5"
    callback.HSEvent P
End Sub


Reply | Threaded
Open this post in threaded view
|

Re: ActiveX followup message

Scott-2
After alot of trial an error, I tried to define my IDL as follows and
this seems to resolve all my problems.

HRESULT HsEvent([in] SAFEARRAY(VARIANT) parms);

Thanks for the great forum.
Scott

[hidden email] (Scott) wrote in message news:<[hidden email]>...

> Original message thread.
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=9nlc72%248dls7%241%40ID-50941.news.dfncis.de&rnum=9
>
> Using the custom callback mechnicism in HomeSeer, I have to create an
> callback object to pass to HomeSeer that responds to HSEvent.  My IDL
> is listed in this message.
>
> The problem I have is that when HSEvent is invoke in dolphin, the
> argument "parms" is an invalid Variant.  Registering the callback
> object works just fine and the HSEvent method gets called in
> Smalltalk.
>
> The main issue (I believe) is in the the server side (VB SOURCE CODE)
> that calls the HSEvent.  It is implemented in VB as follows.  I have
> defined in my IDL (client side) that "P" is a VARIANT.  My question is
> what is the right type of the argument "P" being passed?  Can I even
> make this work as stated in dolphin?
>
> Any help would be greatly appreciated.
> Thanks,
> Scott
> [hidden email]
>
> ---------------IDL FILE----------------
> [
>   uuid(EC366884-7D7F-431C-BA7A-CF2F13FF1686),
>   version(1.0)
> ]
> library Temp
> {
>     importlib("stdole2.tlb");
>
>     // Forward declare all types defined in this typelib
>     interface _Application;
>
>     [
>       odl,
>       uuid(81DA5F54-BED0-454C-BEF3-1700444AC484),
>       version(1.0),
>       hidden,
>       dual,
>       nonextensible,
>       oleautomation
>     ]
>     interface _Application : IDispatch {
>         [id(0x60030000)]
>         HRESULT HsEvent([in] Variant parms);
>     };
>
>     [
>       uuid(3835A8A8-FB31-4024-8677-9D549BA005FA),
>       version(1.0)
>     ]
>     coclass Application {
>         [default] interface _Application;
>     };
> };
>
>
> ------------VB SOURCE CODE------------
> Sub WriteLog ( message as String)
>     Dim P(5) As Variant
>     P(0) = "0"
>     P(1) = "1"
>     P(2) = "2"
>     P(3) = "3"
>     P(4) = "4"
>     P(5) = "5"
>     callback.HSEvent P
> End Sub