1. EuCOM

--------------------------------------
[this line left intentionally blank]

--------------------------------------
[this line left intentionally blank]

--------------------------------------
[this line left intentionally blank]

--------------------------------------
[this line left intentionally blank]

--------------------------------------
[this line left intentionally blank]

--------------------------------------
[this line left intentionally blank]


I've updated my page with a new version of EuCOM (2.03).  I added a couple
of functions.  

* One allows you get an instance of an object that's already running instead
of creating another instance (i.e., Microsoft Excel).  

* The other feature allows you to turn a variant of type VT_ARRAY or
VT_SAFEARRAY into a sequence.  It does this automatically after invoke().  I
updated the Excel demo to get a range of values, rather than one at a time.
This should be a lot faster for many values.

http://www14.brinkster.com/matthewlewis/projects.html
	
Matt Lewis

new topic     » topic index » view message » categorize

2. Re: EuCOM

could you make a euphoria plugin(like flash) for internet exploder and
netscrape. Like an activex which does use COM as i remember. So people and
us opengl, or exotica or winlib with euphoria in an internet browser

----- Original Message ----- 
From: "Matt Lewis" <matthewwalkerlewis at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Subject: EuCOM


> --------------------------------------
> [this line left intentionally blank]
>
> --------------------------------------
> [this line left intentionally blank]
>
> --------------------------------------
> [this line left intentionally blank]
>
> --------------------------------------
> [this line left intentionally blank]
>
> --------------------------------------
> [this line left intentionally blank]
>
> --------------------------------------
> [this line left intentionally blank]
>
>
> I've updated my page with a new version of EuCOM (2.03).  I added a couple
> of functions.
>
> * One allows you get an instance of an object that's already running
instead
> of creating another instance (i.e., Microsoft Excel).
>
> * The other feature allows you to turn a variant of type VT_ARRAY or
> VT_SAFEARRAY into a sequence.  It does this automatically after invoke().
I
> updated the Excel demo to get a range of values, rather than one at a
time.
> This should be a lot faster for many values.
>
> http://www14.brinkster.com/matthewlewis/projects.html
>
> Matt Lewis
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>
>

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

3. EuCOM

Hi Matt,

While generating wrapper from ocx file, TBrowse utility does not create the last
parameter for reg_com_eventsink() if there are no events present for the ActiveX
control.

I have this non-visible ActiveX control OneWayX.ocx for which
reg_com_eventsink() is created as -

reg_com_eventsink( OneWay_clsid_ix, IOneWayEvents, {} )


resulting in compilation error "4 parameters required".

On manually adding a null string at the end, the compilation goes through.

reg_com_eventsink( OneWay_clsid_ix, IOneWayEvents, {}, {} )


==================

I am having problem with getting a Boolean return value from ocx function, which
is always returned as 65535.
http://www.openeuphoria.org/EUforum/m16124.html

I got the following feedback from the ocx author:

------------------

I'm not sure which language you are using, but 1Way uses a VARIANT_BOOL data
type which is compatible with the .NET system.boolean data type.

This is a 4-byte boolean value. The internal representation is 

hex 00000000 = False
any non-zero value is considered to be True.

Usually True is set as hex FFFFFFFF (or -1 decimal).

You are getting a value of 65535 which is hex FFFF considered as an unsigned
integer. So it looks like your program is only looking at 2 bytes, rather than 4,
and it is taking it to be an unsigned integer rather than a boolean value.

------------------

How can this Boolean value be retrieved?

Regards,
Rad.

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

4. Re: EuCOM

Rad wrote:
> 
> Hi Matt,
> 
> While generating wrapper from ocx file, TBrowse utility does not create the
> last parameter for reg_com_eventsink() if there are no events present for the
> ActiveX control.
> 
> I have this non-visible ActiveX control OneWayX.ocx for which
> reg_com_eventsink()
> is created as -
> 
> }}}
<eucode>
> reg_com_eventsink( OneWay_clsid_ix, IOneWayEvents, {} )
> </eucode>
{{{

> 
> resulting in compilation error "4 parameters required".
> 
> On manually adding a null string at the end, the compilation goes through.
> 
> }}}
<eucode>
> reg_com_eventsink( OneWay_clsid_ix, IOneWayEvents, {}, {} )
> </eucode>
{{{


OK, I'll look at this...

> ==================
> 
> I am having problem with getting a Boolean return value from ocx function,
> which
> is always returned as 65535.
> <a
> href="http://www.openeuphoria.org/EUforum/m16124.html">http://www.openeuphoria.org/EUforum/m16124.html</a>
> 
> I got the following feedback from the ocx author:
> 
> ------------------
> 
> I'm not sure which language you are using, but 1Way uses a VARIANT_BOOL data
> type which is compatible with the .NET system.boolean data type.
> 
> This is a 4-byte boolean value. The internal representation is 
> 
> hex 00000000 = False
> any non-zero value is considered to be True.
> 
> Usually True is set as hex FFFFFFFF (or -1 decimal).
> 
> You are getting a value of 65535 which is hex FFFF considered as an unsigned
> integer. So it looks like your program is only looking at 2 bytes, rather than
> 4, and it is taking it to be an unsigned integer rather than a boolean value.
> 
> 
> ------------------
> 
> How can this Boolean value be retrieved?

Looking at getVariant() in variant.ew, it looks like I'm treating a VT_BOOL 
as a 4 byte unsigned int, but that's not quite right.  The response you
got isn't quite right, either.  Technically, it should be a short signed
int (which makes sense, given the result):

http://msdn2.microsoft.com/en-us/library/ms891678.aspx
VT_BOOL 	A Boolean, True/False, value was specified. A value of 
0xFFFF, all bits set to one, indicates True; a value of 0x0000, all bits 
set to zero, indicates False. No other values are valid.

So I'm not handling it exactly correctly.  I suspect that I never found 
this because most COM objects seem to have been written in C++, which 
actually treats boolean values similar to how we use them in euphoria.

It sounds like the author is using managed code, which may well use a 
4-byte representation, but COM probably converts it to 2-bytes to conform
to what it expects.

In getVariant, change the line for VT_I2 to read:
elsif find( vt, {VT_I2, VT_BOOL}) then

...and you should get the -1 (assuming that's important for you).  Also,
if you pass a VT_BOOL to this control, I'd recommend passing -1 as either
a VT_I4 or VT_I2.  COM should convert it to a VT_BOOL for you.

Matt

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

5. Re: EuCOM

Matt Lewis wrote:
> 
> In getVariant, change the line for VT_I2 to read:
> }}}
<eucode>
> 	elsif find( vt, {VT_I2, VT_BOOL}) then
> </eucode>
{{{

> ...and you should get the -1 (assuming that's important for you).  Also,
> if you pass a VT_BOOL to this control, I'd recommend passing -1 as either
> a VT_I4 or VT_I2.  COM should convert it to a VT_BOOL for you.
> 
> Matt

Hi Matt,

Thanks for the solution, it worked!
But instead of clubbing VT_BOOL with VT_I2, I am using it as a new elsif
condition:

-- rad 2007-08-23 : multiply by -1 to remove sign from boolean value
	elsif vt = VT_BOOL then
		return bytes_to_signed( peek( {pval, 2} ) ) * -1
-- rad 2007-08-23


Also, in TBrowse.exw, I have edited the construction of 4th parameter for
wrap_default_event_interface() as:

--	if count then
--		put( "\n\t},\n\t{ " & sprint( membernames[2][1] ) )
--	end if
	put( "\n\t},\n\t{" )

	line = ""	 
--	for j = 2 to count do
	for j = 1 to count do
		--put( ", " & sprint( membernames[2][j] ) )
--		line &= ", " & sprint( membernames[2][j] )
		if j != 1 then
			line &= ","
		end if
		line &= "\n\t" & sprint( membernames[2][j] )
	end for


on the similar basis of previous for loop.

Regards,
Rad.

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

6. EuCOM

Hi all,

I've posted an update to EuCOM.  I think it should work on NT/2000 now, as
I've fixed the incorrect structures that were causing memory exceptions.
It's up on the Contributions page (although it looks like Rob updated the
DirectX entry instead of the EuCOM entry :).  The file is right, but you'll
have to look down the list a little bit, or you can get it at:

http://www14.brinkster.com/matthewlewis/projects.html

It also includes a type library browser (TBrowse.exw) that can generate an
include file for using a COM object.  (A type library is like a machine
readable help file, containing specs on all of the
objects/members/structures etc contained in a COM object).  

For those interested in DirectX programming, use TBrowse on dxvb8.dll in
your system directory to generate an include file (that's what I did for my
DirectX demo).  Just be aware that even though it will generate code for a
dispinterface, you have to call the member functions directly, using vtable
offsets (call_interface/call_interface_ptr instead of invoke/invoke_ptr).  

Matt Lewis 

PS Win32Lib developers may want to look at TBrowse--I implemented the
resizing of the two side by size lists.  Try clicking and dragging in
between the lists and resizing the window.

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

7. Re: EuCOM

Matthew Lewis writes:
> I've posted an update to EuCOM.  I think it should work 
> on NT/2000 now, as I've fixed the incorrect structures 
> that were causing memory exceptions.
> It's up on the Contributions page (although it looks 
> like Rob updated the DirectX entry instead of the EuCOM entry :).

Whoops. Sorry about that.
I've fixed it now (I hope). 

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

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

8. EuCOM

MTS's of the world beware!  I just sent my COM library to Rob.  It's also up
on my web page:

http://www14.brinkster.com/matthewlewis/EuCOM.zip (~92K)

It enables Euphoria to use COM objects (yes, this includes DX, although
since that's not my cup of tea, I haven't done anything with it) and ActiveX
controls.

There's a demo that shows how to use ActiveX controls.  A spreadsheet
control (sgrid.ocx) is included.

Matt Lewis

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

Search



Quick Links

User menu

Not signed in.

Misc Menu