General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › XM5.5 API Something changed? CreateObject
-
leo71 April 21, 2009 at 2:28 pm
XM5.5 API Something changed? CreateObject
April 21, 2009 at 2:28 pmParticipants 5Replies 6Last Activity 13 years, 11 months agoHi,
I used to have the following prehistoric VB6 function to initiate the XMetal application thing:
Public Sub InitXmetal()
On Error GoTo unableToLoad
Set mvarObjXmetalApp = GetObject(, “XMetaL.Application”)
mvarYnObjXmetalApp = True
'mvarObjXmetalApp.PreventExit App.Title, “Cannot close XMetal; BTB is using it. Close BTB first.”
Exit Sub
unableToLoad:
Set mvarObjXmetalApp = CreateObject(“XMetaL.Application”) ' here it goes wrong
mvarYnObjXmetalApp = False
End SubWhen it falls back to the unableToLoad section, it fails at the CreateObject(“XMetaL.Application”) section. It appears to me that something has changed in the XMetal 5.5 API. In all previous versions in XMetal it works fine…
Derek Read April 23, 2009 at 11:20 pm
Reply to: XM5.5 API Something changed? CreateObject
April 23, 2009 at 11:20 pmEither your script is missing some bits, or has a few typos in it (whatever the case I don't quite understand how it should work, so maybe it's just me).
I have no problem launching XMetaL Author Enterprise 5.5 using VB / VBScript:
[code]Set someVar = CreateObject(“XMetaL.Application”)[/code][code]Dim someVar
someVar = CreateObject(“XMetaL.Application”)[/code]…and with JScript using this:
[code]var someVar = new ActiveXObject(“XMetaL.Application”);[/code]The only thing I can think of is that for some reason XMetaL Author might not have been registered properly on your machine during installation (which is necessary to work with it using COM). You might try performing a “Repair” from the Add or Remove Programs tool in the Windows Control Panel, reinstalling, or running the following at a command prompt:
xmetal55.exe /regservermarkusmetzler May 19, 2009 at 7:40 pm
Reply to: XM5.5 API Something changed? CreateObject
May 19, 2009 at 7:40 pmxmetal55.exe /regserver fixes the problem on our machines.
I think the installers changed with XM 5.5 (Essential, Enterprise). They do not register the application anymore.
Derek Read May 19, 2009 at 8:07 pm
Reply to: XM5.5 API Something changed? CreateObject
May 19, 2009 at 8:07 pmRegistration at the command line (via xmetal55.exe /regserver) is something that will currently need to be handled separately from our installation process for people that need this feature.
For people not familiar with this feature, it means controlling XMetaL Author via some other process where a script that is external to an XMetaL macro (MCR) file needs to communicate with XMetaL Author. JScript provides “ActiveXObject()” and VBScript provides “CreateObject()” for this and you might also do something similar from a VB, C# or other type of compiled application.
We are looking into how to best resolve this issue in the future with regards to Vista security (UAC) and limited users. However, I have yet to find any information on this specific subject (including Windows 7 which we will likely support at some point after the official release).
leo71 May 20, 2009 at 6:37 am
Reply to: XM5.5 API Something changed? CreateObject
May 20, 2009 at 6:37 amThanks.
On my own computer (winxp) I didn't have any problems yet.
But my colleague did try 2 times to install XMetal 5.5 and our own custom toolset and get it working.
(Without knowing your patch).
This week she tried for the third time because I said I maybe had a solution, but surprise surprise it did work already. Maybe xmetal55.exe got registered succesfully by itself already.But thanks anyway, I hope that I understand the problem a little bit better.
XMetaLOldTimer May 23, 2009 at 12:39 am
Reply to: XM5.5 API Something changed? CreateObject
May 23, 2009 at 12:39 amUnfortunately, the XMetaL Author 5.5 installer has a bug specifically related to the COM registration of our XMetaL automation server objects (i.e. XMetaL.Application, XMetaL.Global, etc).
If you installed XMetaL Author anywhere other than “C:Program FilesXMetaL 5.5Author”, you would encounter this COM registration problem. The 5.5 SP1 installer corrects this problem.
Manually running “xmetal55.exe /RegServer” from a command-prompt window also corrects this problem if you don't want to apply the service pack.
Regards,
Addammarkusmetzler September 6, 2010 at 2:08 pm
Reply to: XM5.5 API Something changed? CreateObject
September 6, 2010 at 2:08 pmHello,
I have installed XMetaL Author Essential 6.0 (Fileversion: 4.0.100.1190). I think the issue is active again.
After using “xmetal60.exe /regserver” everything's fine. -
AuthorPosts
- You must be logged in to reply to this topic.