Aller au contenu principal

Recherche

Recherche

Automating Bartender Via Dcom

Commentaires

11 commentaires

  • Avatar
    Ian Ian
    Modérateur

    You need to have BarTender installed on the local machine where your application is running.

    0
  • Avatar
    Legacy Poster
    Thank you!

    Now I'm getting the following message:
    ---------------------------
    Windows Script Host
    ---------------------------
    Script: D:\Work\BarTender\test02.vbs
    Line: 1
    Char: 1
    Error: Permission denied: 'CreateObject'
    Code: 800A0046
    Source: Microsoft VBScript runtime error
    
    ---------------------------
    OK
    ---------------------------
    0
  • Avatar
    Ian Ian
    Modérateur

    Do you have BarTender installed on the same computer?  Is the installed BarTender activated as Automation edition or higher, or running as Trial within the trial period?  If no to both of these then that is why it is not working.  The second parameter in the CreateObject call should not be there.  It should only be: Set btApp = CreateObject("BarTender.Application")

    0
  • Avatar
    Legacy Poster
    You are wrong. The second parameter should be there, as long as I'm trying to run BarTender from another machine (as I wrote in the very first message).

    Please see here:

    Syntax

    CreateObject(servername.typename [, location])
    Arguments
    servername
    Required. The name of the application providing the object.

    typename
    Required. The type or class of the object to create.

    location
    Optional. The name of the network server where the object is to be created.

    By the second argument, I am specifying the machine name where I actually want the Bartender.Application object to be created.

    This technology is called DCOM, in contrast to what you are talking about, COM.
    0
  • Avatar
    Legacy Poster
    By the way, your previous advice helped me. Now I'm expiriencing some sort of permission issue.
    0
  • Avatar
    Ian Ian
    Modérateur

    We don't support DCOM.

    0
  • Avatar
    Legacy Poster
    What exactly do you mean:

    1) The BarTender COM object does not support DCOM
    or
    2) You do not provide technical support about using the BarTender COM object in that way?

    If (1), then you are wrong. The object doesn't even know than it is being created at the command of a process running on another machine. It is being created by the DCOM system on the local machine.

    If (2), then it's a pity.
    0
  • Avatar
    Ian Ian
    Modérateur

    I believe that although theoretically possible, as you already allude to, assuming you overcome the permissions spider's web, but that there might still remain some BarTender specific reasons as to why this will not work as you hope.  I'm going from multi-year old memory here so cannot give precise details.

     

    In any case, we don't provide technical support for this should you persist in trying.

    0
  • Avatar
    Legacy Poster

    I have succeeded!!!

     

    Firstly, I added myself to Distributed COM Users security group on the target machine.
    Secondly, on the target machine in dcomcnfg.exe at My Computer level, I gave all Launch and Activation Permissions to myself (see the attached screenshot).

    0
  • Avatar
    Legacy Poster

    The following code:

    Set btApp = CreateObject("BarTender.Application", "bartender.mydomain.local")
    MsgBox btApp.Version
    btApp.Quit 1
    

    outputs the following now:

    ---------------------------
    
    ---------------------------
    9.01
    ---------------------------
    OK   
    --------------------------- 

    9.01 is the BarTender version installed on the server (bartender.mydomain.local). The computer where I run the script from, has version 10.1 installed.

    0
  • Avatar
    Legacy Poster
    I've noticed that BarTender even doesn't have to be installed on client machine.
    This small registry setting is enough:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Bartender.Application]
    
    [HKEY_CLASSES_ROOT\Bartender.Application\CLSID]
    @="{B9425246-4131-11D2-BE48-004005A04EDF}"
    
    0

Vous devez vous connecter pour laisser un commentaire.