1
0
-1

Hi All,


I've created an ActiveX usercontrol in Visual Studio C# which can be used within the OCX control of Uniface. Interacting with the ActiveX usercontrol using provided methods works fine. But I want Uniface to react on events happening in the usercontrol as well. For instance the user clicks on a button in the usercontrol on which Uniface has to respond. I would like to call an Uniface extended trigger.


So far I found a method to bubble up an event from an usercontrol to the parent control, but this seems to be only the case for ActiveX components. I want to expose the event to Uniface extended trigger like explained in the Uniface documentation about OCX controls.


Does anyone have suggestions about how to accomplish this.


Thanks in advance.

John

    CommentAdd your comment...

    2 answers

    1.  
      1
      0
      -1

      Hi John,

      I've found the following info in my archive:

      Exposing .NET controls to Uniface

      The following currently needs to be done for the .NET control in order to make the .NET control visible for Uniface:

      • The .NET control needs to be exposed as COM/OCX control.
      • The actions or events need to be exposed by means of pure virtual classes (java interface and C# interface definitions).
      • Delegates (in C# and VB.NET) have to be defined for actions and events.
      • The pure virtual classes need to be exposed for COM interoperability by means of attributes.
      • The key "control" needs to be added to the registry definition of the .NET control in order to make it visible in the Uniface OCX selection dialog box.
      • The .NET control needs to be exposed for COM interoperability by means of attributes.
      • Get and set operations need to be defined for each property.
      • The properties need to be exposed by means of pure virtual classes (java interface and C# interface definitions).

      I hope this helps.

      Kind regards,

      Daniel

      1. Stijn Courtheyn

        It's also possible without the COM registration in WIndows.
        We changed the Uniface.exe, Idf.exe, userver.exe manifest file to have the .Net components in Uniface without registration

      CommentAdd your comment...
    2.  
      1
      0
      -1

      Hello Daniel,


      I've succeeded in getting the extended triggers in Uniface based on the event in the ActiveX COM/OCX usercontrol, but I get two triggers instead of one, namely add_buttonclicked and remove_buttonclicked, both with a handle as argument. I would like just one trigger buttonclicked with some arguments containing some values (numeric and string) to pass to Uniface.


      Any idea how to accomplish this.


      Thanks in advance.

      John

      1. Daniel Iseli

        Hello John,

        Maybe the following helps?

        Microsoft Interop Forms Toolkit 2.0

        Interop Forms Toolkit 2.0 Tutorial

        This should also work with Uniface.

        I don't think I have a working sample for this. But I know that customers are using .Net user controls (including Extended Triggers) in their applications. Maybe another forum user can share his experience here?

        Thanks,
        Daniel

      CommentAdd your comment...