Re: Accessing an Exe written in C
- Posted by ramarin at teleport.com Sep 10, 2003
- 360 views
Matt Lewis wrote: > > >>From: Stephen O' Sullivan [mailto:stephen_o__sullivan at hotmail.com] >> >>Hi All, >>I am relatively new to Euphoria, so forgive me if this an obivous >>question. >> >>What I have is a Exe written in C, that I want to access in >>Euphoria. I >>know how to acess the interfaces in VB. All I have to do is add the >>reference to my project and use code, such as follows, to >>call funtions >>and procedures: >> >>Dim MyInterFace as InterFaceName >>... >>Set MyInterface=New LibName >>MyInterFace.Procedure (params) >>MyInterFace.Function (params) >>... >> >>Does anybody know how to do this in Euphoria? > > > What you seem to be describing here seems to be a COM object (VB just loves > 'em). You can use EuCOM (see the user archives) to interface with the exe. > The first thing you'll want to do is to use TBROWSE (comes with EuCOM) to > wrap the object. Then, your Eu version of the VB example would look > something like: > > include EuCOM.ew > include InterfaceName.ew > > integer MyInterface > object result > > MyInterface = create_com_object( InterfaceName_clsid_ix ) > > result = invoke( MyInterface, {MyInterface_m_Procedure[,optional param > names]}, > {[params]},{[param data types]},DISPATCH_METHOD ) > > result = invoke( MyInterface, {MyInterface_m_Function[,optional param > names]}, > {[params]},{[param data types]},DISPATCH_METHOD ) > > > It's a bit more complicated, but it's really not too hard once you get the > hang of it (just more typing). Take a look at EuCOM, read the Docs and FAQ, > and let me know if you have any other questions. > > Matt Lewis > > > > TOPICA - Start your own email discussion group. FREE! > > -- Roger Marin 8825 S.E. Hawthorne Blvd. Portland, OR, 97216-1821 Voice: 503.253.3195