1. Interfacing with COM objects

Hi all,
I'm trying to write some eu code to interface with an existing COM object.
The COM comes from a tv tuner/teletext card. tBrowse has been used on an .ocx
file associated with the card, with the following .ew include being generated:

global constant
ActiveTeletextControl_clsid = "17694D67-AB0C-11D2-A6E6-0020AF5C86D3",
ActiveTeletextControl_clsid_ix = add_clsid( ActiveTeletextControl_clsid) ,
ActiveTeletextControl_disp = add_iid( ActiveTeletextControl_clsid_ix,
IDispatch),
ActiveTeletextControl_IQuickActivate_ix = add_iid( 
	ActiveTeletextControl_clsid_ix, IQuickActivate ),
ActiveTeletextControl_IPersistStreamInit_ix = add_iid( 
	ActiveTeletextControl_clsid_ix, IPersistStreamInit ),
ActiveTeletextControl_IConnectionPointContainer_ix = 
	add_iid( ActiveTeletextControl_clsid_ix, IConnectionPointContainer )


--methods

-- disp methods for ActiveTeletextControl
global constant








ActiveTeletextControl_m_PauseScanning = 37,
    -- Returns:  VT_VOID


ActiveTeletextControl_m_RequestPage = 10,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_NextPage = 11,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_PrevPage = 12,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_SelectAll = 13,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_FirstSubPage = 14,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_NextSubPage = 15,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_PrevSubPage = 16,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_LastSubPage = 17,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_GoHome = 18,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_GoIndex = 19,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_CanGoIndex = 20,
    -- Returns:  VT_I4
ActiveTeletextControl_m_ForwardInHistory = 21,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_BackInHistory = 22,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_CanGoBackInHistory = 23,
    -- Returns:  VT_BOOL
ActiveTeletextControl_m_CanGoForwardInHistory = 24,
    -- Returns:  VT_BOOL
ActiveTeletextControl_m_GetStationName = 25,
    -- Returns:  VT_BSTR
ActiveTeletextControl_m_GetStationNumber = 26,
    -- Returns:  VT_I2
ActiveTeletextControl_m_GotoFastText = 27,
    -- Returns:  VT_VOID
    -- Link VT_I2 
ActiveTeletextControl_m_CanGotoFastText = 28,
    -- Returns:  VT_BOOL
    -- Link VT_I2 
ActiveTeletextControl_m_GetNoOfFastTextLinks = 29,
    -- Returns:  VT_I2
ActiveTeletextControl_m_GetFastText = 30,
    -- Returns:  VT_BSTR
    -- Link VT_I2 
ActiveTeletextControl_m_GetNoOfSubPages = 31,
    -- Returns:  VT_I4
ActiveTeletextControl_m_ClearHistory = 32,
    -- Returns:  VT_VOID
ActiveTeletextControl_m_SetHold = 33,
    -- Returns:  VT_VOID
    -- fHold VT_BOOL 
ActiveTeletextControl_m_GetHold = 34,
    -- Returns:  VT_BOOL
ActiveTeletextControl_m_GetReveal = 36,
    -- Returns:  VT_BOOL
ActiveTeletextControl_m_SetReveal = 35
    -- Returns:  VT_VOID
    -- fReveal VT_BOOL 
ActiveTeletextControl_m_ResumeScanning = 38,
    -- Returns:  VT_VOID




--properties

-- disp properties for ActiveTeletextControl
global constant
ActiveTeletextControl_p_Channel = 1,
    -- Property:  VT_I4
ActiveTeletextControl_p_Page = 2,
    -- Property:  VT_I4
ActiveTeletextControl_p_SubPage = 3
    -- Property:  VT_I4
ActiveTeletextControl_p_Mode = 4,
    -- Property:  VT_I4
ActiveTeletextControl_p_FontName = 5,
    -- Property:  VT_BSTR
ActiveTeletextControl_p_AutoSubPages = 6,
    -- Property:  VT_BOOL
ActiveTeletextControl_p_IsReveal = 7,
    -- Property:  VT_BOOL
ActiveTeletextControl_p_IsShowLinks = 8,
    -- Property:  VT_BOOL
ActiveTeletextControl_p_EnableSelect = 9,
    -- Property:  VT_BOOL


-- Default event interface for ActiveTeletextControl

-- Default event interface for ActiveTeletextControl

global constant
DActiveTeletextControlEvents = "17694D66-AB0C-11D2-A6E6-0020AF5C86D3",
DActiveTeletextControlEvents_ContextMenu = 1,
DActiveTeletextControlEvents_DragStart = 2

-- Event functions for DActiveTeletextControlEvents

procedure DActiveTeletextControlEvents_ContextMenu_proc( atom this )

end procedure

procedure DActiveTeletextControlEvents_DragStart_proc( atom this )

end procedure


reg_com_eventsink( ActiveTeletextControl_clsid_ix, 
	DActiveTeletextControlEvents, 
	{
	 routine_id( "DActiveTeletextControlEvents_ContextMenu_proc" ),
	 routine_id( "DActiveTeletextControlEvents_DragStart_proc" )
	},
	{ 1, 2} )


I've studied hard but can't figure out what needs to be done .... I only want to
request a page and receive the page as a sequence.

Any help much appreciated,
Michael.

new topic     » topic index » view message » categorize

2. Re: Interfacing with COM objects

Michael wrote:
> 
> 
> Hi all,
> I'm trying to write some eu code to interface with an existing COM object.
> The COM comes from a tv tuner/teletext card. tBrowse has been used on an .ocx
> file
> associated with the card, with the following .ew include being generated:
> 

<include file snipped>

> 
> I've studied hard but can't figure out what needs to be done .... I only
> want to request a page and receive the page as a sequence.
> 

It's hard to say without seeing the documentation (if it exists) for 
the teletype program.  You might try firing it up, and then running some
code where you create a COM object and see what happens.  Your Eu program
might look like this (untested):

include eucom.ew
include teletype.ew

com_err_out(1) -- so you can see any diagnostic messages

integer tt

tt = create_com_object( ActiveTeletextControl_clsid_ix )

object result

result = invoke( tt, {ActiveTeletextControl_m_RequestPage}, {}, {},
    DISPATCH_METHOD )

? result

if wait_key() then end if


Just to see what it does.  I'd also recommend trying other methods and
properties to see what they do.  Sometimes that's the only way to figure
out how stuff works.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu