Page 1 of 2 12>
Topic Options
#85737 - 2002-05-25 02:40 AM More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Can anyone double-check this for me ? run this script as-is, the test for the ie createobject works just fine, then comment out the ie create and uncomment the adodb create, same test, but it tests negative (but the object got created just fine) ...

break on

$obj = createobject("internetexplorer.application")

; $obj = createobject("adodb.connection")

if $obj
 ?"ok"
else
 ?"bad"
endif

exit 1


Thanks for any help.

-Shawn

Top
#85738 - 2002-05-25 02:51 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I get an "ok" for each createobject.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85739 - 2002-05-25 02:53 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Howard, what does this give you in rc1

$obj = createobject("internetexplorer.application")

?$obj

-Shawn

Top
#85740 - 2002-05-25 02:55 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Script error : Error in expression: Dispatch pointers not allowed in expressions. !

Same for the ADODB.

[ 25 May 2002, 02:56: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85741 - 2002-05-25 02:56 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Your running 4.10 Release Candidate 1 ?
Top
#85742 - 2002-05-25 02:58 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
@kix = 4.10 Beta 1

Kix32.exe File version 4.10.0.0 dated 4/3/2002 6:06 PM
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85743 - 2002-05-25 03:02 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
could you try release candidate 1, available from here:

here

We should get this posted-up in the downloads section here, don't know why Henri hasn't done that yet.

Top
#85744 - 2002-05-25 03:03 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
where does one get RC1?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85745 - 2002-05-25 03:10 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
C:\Data\Kix2001\KiX2001.410rc1>kix32 test2.kix

ok
C:\Data\Kix2001\KiX2001.410rc1>kix32 test2.kix

bad

--------------------------------
$obj = createobject("adodb.connection")
? $obj

results in nothing displayed.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85746 - 2002-05-25 03:11 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
break on
$obj = createobject("internetexplorer.application")
? $obj

yields

Microsoft Internet Explorer
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85747 - 2002-05-25 03:12 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
try this one though, think you might see something very interesting:

$obj = createobject("internetexplorer.application")
?$obj

Top
#85748 - 2002-05-25 03:14 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Beat you to it. [Razz]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85749 - 2002-05-25 03:19 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Might know whats happening here. Last thing I read, Ruud implemented default properties for COM objects, you know, when you specify just the object name, it will default to the "default property", em, for example, i think the default property for an ADODB recordset FIELD object is the "VALUE" property. Haven't tried it yet though, but this obviously means we can't test object creation like we used to. It also might explain a couple of other issues I've seen.

Do you have a DB script that displays field values - maybe you could see if something gets displayed, even if you omit the VALUE propery.

-Shawn

[ 25 May 2002, 03:21: Message edited by: Shawn ]

Top
#85750 - 2002-05-25 03:25 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Sorry, only DB script I have are Perl.

VarTypeName($obj) reports "Object" if success or "Empty" if failed.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85751 - 2002-05-25 03:34 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
thanks howard, just dug up a script, this seems to be what is going on. Kixtart now supports default COM properties, very nice !

break on

$db = "f:\msaccess\db1.mdb"

$cn = createobject("adodb.connection")

$cn.connectionstring = "data source=$db; provider=microsoft.jet.oledb.4.0;"

$cn.open()

$rs = $cn.execute('select * from table1')

while not $rs.eof()

 ?"cn=" $rs.fields("computername") ; here !

 $rs.movenext

loop

$cn.close()
$cn = 0

exit 1


-Shawn

[ 25 May 2002, 03:35: Message edited by: Shawn ]

Top
#85752 - 2002-05-25 03:41 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I also grabbed an ADO script from the posts today.

I do not fully understand COM. Could you explain this issue in more detail?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85753 - 2002-05-25 04:00 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
well, for example, the internetexplorer.application object has a whole whack of properties, like VISIBLE and WIDTH and HEIGHT and others. normally, one would have to specify each property explicitly when referencing it, eg:

$ie.visible = 1
$ie.width = 500

but, usually, all COM objects have a DEFAULT property. This is the property that is referenced when NO property is specified, for example, if NAME is the default property for IE, you would just say:

?"name=" $ie

and out would come the NAME, which IS actually the default property for IE, NAME is the name of the object hosting the webbrowser control, in this case Microsoft Internet Explorer.

So, this is a good thing. But it means that we'll have to be conscious of this fact going forward... and especially given the fact the we destroy an object with this syntax:

$object = 0

not quite sure how Kixtart interprets this now, is this statement trying to set the default property, or destroy the object ?

-Shawn

[ 25 May 2002, 04:04: Message edited by: Shawn ]

Top
#85754 - 2002-05-25 04:04 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Ok. I understand that but is there something significant about the script you posted and the line with ";here !" at the end?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#85755 - 2002-05-25 04:11 AM Re: More COM issues with 4.10 rc1
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
not really, i was just trying to see if this new feature was actually working or not. the only default property I could think of off hand was the VALUE property of the FIELD object, so when I ran that script, i got this:

cn=xxx
cn=yyy
cn=zzz

even though in the script, i didn't say this:

?"cn=" $rs.fields("computername").value

it used this:

?"cn=" $rs.fields("computername")

and it worked. The point is I guess is that this new feature is the cause, i think, of a few problems i've seen lately, like for example, in the first script I posted, testing for object creation.

-Shawn

p.s. not really problems i guess, more along the lines that we will have to change the way we do things. for example, test @ERROR after object creation, instead of the $object variable itself.

[ 25 May 2002, 04:16: Message edited by: Shawn ]

Top
#85756 - 2002-05-25 04:17 AM Re: More COM issues with 4.10 rc1
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Well that may work for reading but it doesn't work for setting a value.

$rs.addnew
$rs.fields.item("computername") = @WKSTA
$rs.fields.item("program") = $item
$rs.fields.item("date").value = @DATE
$rs.fields.item("time").value = @TIME
$rs.update

The first two fields ended up blank.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 2 12>


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 874 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.161 seconds in which 0.095 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org