General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion XM5.5 API Something changed? CreateObject

  • leo71

    XM5.5 API Something changed? CreateObject

    Participants 5
    Replies 6
    Last Activity 13 years, 11 months ago

    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…

    Reply

    Derek Read

    Reply to: XM5.5 API Something changed? CreateObject

    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]

    [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 /regserver

    Reply

    markusmetzler

    Reply to: XM5.5 API Something changed? CreateObject

    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.

    Reply

    Derek Read

    Reply to: XM5.5 API Something changed? CreateObject

    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).

    Reply

    leo71

    Reply to: XM5.5 API Something changed? CreateObject

    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.

    Reply

    XMetaLOldTimer

    Reply to: XM5.5 API Something changed? CreateObject

    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 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,
    Addam

    Reply

    markusmetzler

    Reply to: XM5.5 API Something changed? CreateObject

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support