Re: EuCom - Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jonas Temple wrote:
> 
> 
> Well, like I promised, here I am again!  This time trying another COM 
> control.  Here's the code:
include unocxtl.ew
include win32lib.ew

with trace

constant
Win = create( Window, "Test UNOCX Control", 0, 0, 0, 400, 800, 0 )

object void
atom as400_tree, as400_list, list_ptr
com_err_out( 1 )

as400_tree = create_com_control( AS400Tree_clsid_ix , getHandle( Win ), 5, 5,
375,
as400_list = create_com_control( AS400List_clsid_ix, getHandle( Win ), 5, 400,
375,
list_ptr= invoke(as400_list, {AS400List_m_ReturnPtr},{},{},DISPATCH_PROPERTYGET)
void = invoke(as400_tree,
{AS400Tree_m_SetListOcx},{list_ptr},{VT_I4},DISPATCH_PROPERTYPUT)

WinMain(Win, Normal )

 

First thing I see is that SetListOcx is a method, not a property, so you
should be using DISPATCH_METHOD.  Tbrowse differentiates between the two
by either adding _p_ or _m_ between the object and the member names.
 
> Here I'm trying to create two controls, the list being tied to the tree so
> whenever a selection is made in the tree the list is automatically
> updated.  
> 
> The docs for the control specify that the AS400Tree_m_SetListOcx takes a
> pointer to the list control, which can be retrieved via the 
> AS400List_m_ReturnPtr method.  When I use invoke() to set the list control
> I get the following message:
> 
> 80020005: Type mismatch, arg 1: #00C90210 / vt = 3
> Exception Source:
> Exception Description:
> 
> Not sure what it's trying to tell me.

It's saying that your type is wrong (or maybe it's just the method/property
thing).  My guess is that it should be either VT_UNKNOWN or VT_PTR.  You
can look in variant.ew for all different VT_ constants.

> Here's a VB example I found for doing what I'm attempting to do:
> 
>     TreePtr = AS400Tree1.ReturnPtr
>     ListPtr = AS400List1.ReturnPtr
>     AS400Tree1.SetListOcx (ListPtr)
>     AS400List1.SetTreeOcx (TreePtr)
> 
> At this point I haven't even gotten to the point of setting the list
> control with the tree control.
> 
> Also, in my example code the list/tree seem to overlap on the window.  Have
> any idea why that might be happening?

No.  The values look good to me.

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu