Re: EuCOM - Passing an object to another object
- Posted by Jonas Temple <jtemple at yhti.net> Apr 04, 2006
- 783 views
Matt Lewis wrote: > You should probably use get_obj_this(). When you pass a EuCOM handle, it > will return the actual pointer to the object. get_obj_from_this() goes > the other way. The parameter type should be either VT_DISPATCH or > VT_UNKNOWN. Well at least I was on the right track... I tried the get_obj_from_this() with type VT_DISPATCH and VT_UNKNOWN. On one of the invoke() calls I get a machine exception from call_stdcall_proc(). Here's the interface definition from the include created by tbrowse:
-- disp methods for AutScreenReco global constant AutScreenReco_m_AddPS = 1610743808, -- Add a PS object to monitor to the autScreenReco Object -- Returns: VT_VOID -- AutPS VT_DISPATCH [IN] AutScreenReco_m_IsMatch = 1610743812, -- Compare a given PS to a given Screen Description -- Returns: VT_VOID -- AutPS VT_DISPATCH [IN] -- ScreenDescription AutScreenDesc [IN] AutScreenReco_m_RegisterScreen = 1610743810, -- Register the Screen Description with the Screen Recognition -- Object -- Returns: VT_VOID -- ScreenDescription AutScreenDesc [IN] AutScreenReco_m_RemovePS = 1610743809, -- Remove a PS object from the autScreenReco Object -- Returns: VT_VOID -- AutPS VT_DISPATCH [IN] AutScreenReco_m_UnregisterScreen = 1610743811 -- Unregister a Screen Description from the Screen Recognition -- Object -- Returns: VT_VOID -- ScreenDescription AutScreenDesc [IN]
the error is happening on the m_RegisterScreen method. The call to m_AddPS works file and as you can see, the AutPS object is defined the VT_DISPATCH. However in m_RegisterScreen the "RegisterScreen" object is defined as AutScreenDesc, not VT_DISPATCH or VT_UNKNOWN. What's the difference between the two? Thanks! Jonas Temple http://www.yhti.net/~jktemple