Page 1 of 2 12>
Topic Options
#86588 - 2002-07-08 04:58 PM IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
How compatable is KiXGUI with 4.10? I've seen some topics related to IDispatch errors with other COM objects and have subsequently changed some of my code, but I'm still getting errors.

Here's my code...

code:
$root=createobject("KiXGUI.Desktop")
if not $root ;Changed from "if len($root)=0"
? "KiXGUI not registered."
endif
;---------------------------------------------------------------------------
; Show Logo
;---------------------------------------------------------------------------
if $root
$imgfile=@SCRIPTDIR+"\mblogo.gif"
$frmLogo=$root.createform("frmLogo","Logo",20,20,258,101)
$frmLogo.moveable=0
$frmLogo.ResizeAble=0
$frmLogo.showintaskbar=0
$frmLogo.TitleBar=0
$frmLogo.layered=100
$frmLogo.TopMost=1
; The following line creates an object, so not assigning it to a variable creates
; an "IDispatch pointers not allowed in expressions!" error.
;$frmLogo.addimage($imgfile,$imgfile,0,0,$frmLogo.width+2,$frmLogo.height)
; Passing method to a variable fixes it. THANKS, Shawn!!!
$obj = $frmLogo.addimage("imgLogo",$imgfile,0,0,$frmLogo.width+2,$frmLogo.height)
$frmLogo.visible=1
endif

{EDIT: Changed example to reflect the actual line causing the error, plus the fix for it.}

[ 09 July 2002, 14:27: Message edited by: Chris S. ]

Top
#86589 - 2002-07-08 05:00 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Try taking off the IF NOT $ROOT and replacing with IF @ERROR
Top
#86590 - 2002-07-08 05:02 PM Re: IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Its not "erroring" on that line, but rather the addimage line.

{EDIT: Changed message to reflect actual error.}

[ 08 July 2002, 18:23: Message edited by: Chris S. ]

Top
#86591 - 2002-07-08 05:16 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Double check your AddImage method call, are your missing a parm ? If one adds a zero as last parm, does it work ?
Top
#86592 - 2002-07-08 05:46 PM Re: IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Shawn, you're right it was the AddImage call. I misread the KiXGUI documentation.

quote:

AddImage Parameters
Method Name The internal name of the object String
Image The full path and name of the image String
Left Optional. Set the left property Long
Top Optional. Set the top property Long
Width Optional. Set the width property Long
Height Optional. Set the height property Long

Return value The created control Object
Example : Form.addImage(''NewImage'',"C:\Image.bmp" ,15,15)
Notes

The example uses two single-quotes for the AddImage "name," but it looks like double-quotes when you print the documentation. I found it when I was copying the documentation into UltraEdit so I could post it here.

Now, the form is displaying but the image is "greyed" out. I'll keeping working on it.

The funny thing is it worked in 4.02. [Confused]

[ 08 July 2002, 17:47: Message edited by: Chris S. ]

Top
#86593 - 2002-07-08 06:16 PM Re: IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Well...it seems that it will not display the image without the double-quotes. I reverted back to 4.02 and it didn't display the image with single-quotes in the "name" parameter. Double-quotes work in 4.02, but not 4.10.

Alex??????

Top
#86594 - 2002-07-08 06:51 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Give me one more kix at the KixGUI kan, k ? [Wink]

try this:

$obj = $frmLogo.addimage("imgLogo",$imgfile,0,0,$frmLogo.width+2,$frmLogo.height)

-Shawn

[ 08 July 2002, 18:52: Message edited by: Shawn ]

Top
#86595 - 2002-07-08 06:53 PM Re: IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Shawn, you are the man. Many thanks.
Top
#86596 - 2002-07-08 06:56 PM Re: IDispatch errors using 4.10(Final)
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Is it because "as written" the example is trying to echo the return code?
Top
#86597 - 2002-07-08 07:03 PM Re: IDispatch errors using 4.10(Final)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I had idispatch error too on kixforms and kixtart was erroring on simple:
$data=1

heh, found out that subfunction code was messing with object-handles elsewhere.

shawn, did you read that mail about 4.11?

cheers,
_________________________
!

download KiXnet

Top
#86598 - 2002-07-08 07:07 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Actually, that was the problem - AddImage returns an object, and you weren't assigning it to anything, so it was being "evaluated", like if you just put this in your script:

break on

2+2

exit 1

2+2 gets evaluated because its not assigned, and piped to the console. Likewisem, your Image object was being evaluated. This was identified to Ruud quite some time ago - thought he "fixed" that - guess not.

-Shawn

Top
#86599 - 2002-07-08 07:12 PM Re: IDispatch errors using 4.10(Final)
Alex.H Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 406
Loc: France
It's right, Chris.
$frmLogo.addanycontrol return the created object. If you don't have a variable to catch it, kixtart will try to show it on the dos box, and as it's an object, you ran into the idispatch error (doing this with any com object will result in the same error)
_________________________
? getobject(Kixtart.org.Signature)

Top
#86600 - 2002-07-08 07:42 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Ruud has already identified this as an undesirable behavior, and might (should) fix it in the next maintenance build. Prior to 4.10, un-caught object handles were being thrown into the bit-bucket (but like Lonkero noted - was faking WKIX32 into believing that console output was being performed, and throwing-up a DOS box).

Jooel - did catch your email - great news !

Top
#86601 - 2002-07-08 09:25 PM Re: IDispatch errors using 4.10(Final)
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We read it too late. We have already update our site with the latest release.
Scriptlogic topic reports problems with the
macro's
- @LServer
- @FullName
- @Comment
- @PrimaryGroup
and Shawn discover another problem. Ruud is already working on it.

For those we need the previous iexpress packages use the temporary links
kix410.95-registry.exe
kix410.95-update.exe
wkix410.95-update.exe

greetings.

btw: Shawn, good work.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#86602 - 2002-07-08 09:54 PM Re: IDispatch errors using 4.10(Final)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
MCA, I haven't sent Ruud a note about this, or pointed him to this thread (yet) ... have you ?
Top
#86603 - 2002-07-08 10:06 PM Re: IDispatch errors using 4.10(Final)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
shawn, who knows...
mca is busy with the updates, so he may just explains that there is something.

but if the shawns discovery points to this
2+2
thingie, hasn't it allways been there?
_________________________
!

download KiXnet

Top
#86604 - 2002-07-08 10:32 PM Re: IDispatch errors using 4.10(Final)
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Shawn,

Our site contains already the latest kixtart 4.10 build 99.
Ruud's zip is calling kix410a.zip. We replace the previous (= based on build 98) iexpress packages with the new one.
We will active monitor possible new 'updates' for the coming period.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#86605 - 2002-07-08 10:37 PM Re: IDispatch errors using 4.10(Final)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
mca, what fixes this update has?
just asking as I don't have e-mail at hand...
_________________________
!

download KiXnet

Top
#86606 - 2002-07-08 10:48 PM Re: IDispatch errors using 4.10(Final)
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear Lonkero,

See bstyles reaction in topic
http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=3;t=000327

We replace the build 98 with this new onem because empty macro values can have dramatic impact
for scripts. Of course nobody goes in production without testing it.
Of course we doesn't know Ruud has already fix above problem, but we have send Ruud a mail about
it.
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#86607 - 2002-07-08 11:01 PM Re: IDispatch errors using 4.10(Final)
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Take also a look a the great resource
Kixtart Development Report by Scriptlogic
greetings.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

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 369 anonymous users online.
Newest Members
rrosell, PatrickPinto, Raoul, Timothy, Jojo67
17877 Registered Users

Generated in 0.049 seconds in which 0.016 seconds were spent on a total of 12 queries. Zlib compression enabled.

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