#86588 - 2002-07-08 04:58 PM
IDispatch errors using 4.10(Final)
|
Chris S.
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
|
|
|
|
#86592 - 2002-07-08 05:46 PM
Re: IDispatch errors using 4.10(Final)
|
Chris S.
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. [ 08 July 2002, 17:47: Message edited by: Chris S. ]
|
Top
|
|
|
|
#86594 - 2002-07-08 06:51 PM
Re: IDispatch errors using 4.10(Final)
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Give me one more kix at the KixGUI kan, k ?
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
|
|
|
|
#86599 - 2002-07-08 07:12 PM
Re: IDispatch errors using 4.10(Final)
|
Alex.H
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
|
|
|
|
#86601 - 2002-07-08 09:25 PM
Re: IDispatch errors using 4.10(Final)
|
MCA
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.
|
Top
|
|
|
|
#86604 - 2002-07-08 10:32 PM
Re: IDispatch errors using 4.10(Final)
|
MCA
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.
|
Top
|
|
|
|
#86606 - 2002-07-08 10:48 PM
Re: IDispatch errors using 4.10(Final)
|
MCA
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.
|
Top
|
|
|
|
#86607 - 2002-07-08 11:01 PM
Re: IDispatch errors using 4.10(Final)
|
MCA
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.
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|