Pages: 1
Print
Author Topic: XM5.5 API Something changed? CreateObject  (Read 5669 times)
leo71
Member

Posts: 25


« on: April 21, 2009, 08:28:00 AM »

Hi,

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 Sub

When 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...
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2507



WWW
« Reply #1 on: April 23, 2009, 05:20:05 PM »

Either 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:
Dim someVar
someVar = CreateObject("XMetaL.Application")

...and with JScript using this:
Code:
var someVar = new ActiveXObject("XMetaL.Application");

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 /regserver
Logged
markusmetzler
Member

Posts: 2


« Reply #2 on: May 19, 2009, 01:40:22 PM »

xmetal55.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.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2507



WWW
« Reply #3 on: May 19, 2009, 02:07:22 PM »

Registration 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).
« Last Edit: May 20, 2009, 11:39:15 AM by Derek Read » Logged
leo71
Member

Posts: 25


« Reply #4 on: May 20, 2009, 12:37:04 AM »

Thanks.

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.
Logged
XMetaLOldTimer
Global Moderator
Member

Posts: 51


« Reply #5 on: May 22, 2009, 06:39:01 PM »

Unfortunately, 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 Files\XMetaL 5.5\Author", 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,
Addam
Logged

Addam Smith, XMetaL Project Lead & Architect
JustSystems Canada Inc.
markusmetzler
Member

Posts: 2


« Reply #6 on: September 06, 2010, 08:08:16 AM »

Hello,
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.
Logged
Pages: 1
Print
Jump to:  

email us