Accessing multiuser projects using E3 COM library

HI everybody!

I have a problem with multi-user projects and COM interface using C# ("E3.series 2018.1901 Type Library")

The project has beel loaded into the server and is visible by the current user via E3 cable.

(I use the flag /multiuser into the shortcut and I have launched the correct .reg file)

 

The issue is about C#. Using the following code:

e3App = Activator.CreateInstance(Type.GetTypeFromProgID("CT.Application")) as IApplicationInterface;
if (e3App != null)
{
res = e3App.SetMultiuserServer(hostname + ":" + port.ToString());
if (res == 0)
{
int projectsCount = e3App.GetMultiuserProjects(ref lstProjects);
if (projectsCount > 0)
[...]

 

The object lstProjects is NULL and projectsCount  is equal to zero.

Please note that when I invoke the method .SetMultiuserServer() with the correct hostname and port (4712) I get success (the return value is zero).

Is there something I am doing wrong?

Thanks a lot for your support.

mm

0

Comments

5 comments
  • Additional info:

    I am using E3 2018 19.03 and also the server has the same version (I applied to both the "same" patch).

    On the server (installed locally on my computer for development purpose) I have only one project loaded into a subfolder I have created with the Admin panel.

    And, finally, using the Admin panel I have linked my user to the project: (without this change the project is not even visible to E3 cable)

     

    Please let me know if you need more info. Thanks again

  • The scenario becomes more complex... Using this simple VBS script, I get all project names..

    Option Explicit

    Dim objApp

    Dim res : res = 0
    Dim projectsCount : projectsCount = 0
    Dim lstProjects
    Dim projectIndex : projectIndex = 0

    ' E3 objects creation
    Set objApp = CreateObject("CT.Application")

    objApp.ClearOutputWindow
    objApp.PutInfo 0, "Script started"

    res = objApp.SetMultiuserServer("itpinb007:4712")
    objApp.PutInfo 0, "Set MU Server result (0=success) " + CStr(res)

    projectsCount = objApp.GetMultiuserProjects(lstProjects)
    objApp.PutInfo 0, "MU Projects count = " + CStr(projectsCount)

    For projectIndex = 1 To projectsCount
    objApp.PutInfo 0, lstProjects(projectIndex)
    Next

    objApp.PutInfo 0, "Script done"

    ' Free memory
    Set objApp = Nothing

    WScript.Quit

  • I am getting closer to the problem...

    After this line of code:

    e3App = Activator.CreateInstance(Type.GetTypeFromProgID("CT.Application")) as IApplicationInterface;

    E3 starts correctly

    But after this line of code:

    int projectsCount = e3App.GetMultiuserProjects(ref lstProjects);

    In the Console of E3 I get this warning:

    W - Currently no license for Multiuser Edition available.

    And lstProjects is NULL..

     

    What is the problem? When I launch E3 via the shortcut I am able to reach the server (and its project) without any problems.. I have Enterprise level licenses!!

     

    Thanks

     

  • Another update!

    I just discovered E3Starter (CT.E3Starter) which allows to start E3 with any parameter (example "/multiuser")

    This is code example:

    Set oProcessStarter = CreateObject("CT.E3Starter")
    Set oE3 = oProcessStarter.StartSameImage( "/multiuser", -1 )

    That is ok but how I have to declare oProcessStarter? If I use object, it works but I do not have acces to the method .StartSameImage()

    Any help? Thanks, thanks

    mm

     

  • I think I've found one solution.

    I will use the E3Starter object (suggested also in the offical document named "NewFeaturesenglish.pdf")

    I added the .exe file to the reference of the C# project together with the "Zuken" namespace.

    This is my piece of code:

    oProcessStarter = Activator.CreateInstance(Type.GetTypeFromProgID("CT.E3Starter")) as E3Starter;

    e3App = oProcessStarter.Start(@"C:\Program Files (x86)\Zuken\E3.series_2018\E3.series.exe", "/automation /multiuser", 30000) as IApplicationInterface;

     

    Obviously, I will store the path of the .exe file into the configuration file of the application.

     

    This way the call of the method .GetMultiuserProjects() works correctly and I get all the data I need.

    I posted my solution here maybe can help other guys.

    Thanks

Please sign in to leave a comment.

Didn't find what you were looking for?

New post