Showing results 1 to 2 of 2

Thread: How to Access a from inside a dll from zenon editor

  1. #1
    Join Date

    Default How to Access a from inside a dll from zenon editor

    Hello every body,

    I have developed a dll and embeded it in zenon with ActiveX element.
    Now I want to open a form which I placed in dll project dy clicking on the element in zenon editor.
    Can I do it by using Reflection? The dll project has been developed with C# in VS 2010.

                        Object myObject = obElement.AktiveX();
                        Type myType = myObject.GetType();
                        MethodInfo Method = myType.GetMethod("ShowOptions");
                        Method.Invoke(myObject, null);

    Actually ShowOptions method is a method that makes an instance of the form and shows the form.

    I wrote this code but it doesn't work!
    Is there another way to do it?


  2. #2
    martins Gast

    Default Re: How to Access a from inside a dll from zenon editor


    First of all, I never did that in the Editor, I always just used ActiveX elements in the runtime.

    I guess Reflection should work fine (or at least I don't see why it shouldn't work.

    Is ShowOptions static?
    Is there an instance? Just because you get the type doesn't mean that there is an object behind it. You could call the constructor with this code:

    ConstructorInfo someObjectConstructor = myType.GetConstructor(Type.EmptyTypes);
    object myInstance = someObjectConstructor.Invoke(new object[]{});

    It's maybe a good idea to put it in a Try/Catch Block so you find out which kind of exception is thrown (or take a look in the Debug window if you attached a debugger).

    best regards,

Similar Threads

  1. zenon CE - BeckhNG.dll could not be loaded
    By ptkdennis in forum Drivers
    Replies: 2
    Last Post: 16th April 2014, 07:53
  2. Access ZenOn server tags
    By abcd1234 in forum zenon Network
    Replies: 3
    Last Post: 28th January 2014, 21:18
  3. Replies: 3
    Last Post: 9th December 2013, 10:44
  4. access to dll files
    By hamid in forum zenon Supervisor
    Replies: 2
    Last Post: 3rd October 2011, 14:42
  5. Replies: 0
    Last Post: 20th August 2007, 17:04

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts