Howto: Adding ocx control (non GUI) to a default ABL.NET cla

Posted by Stefan Marquardt on 29-May-2012 08:14

Hello,

this is the first time i have to add an ocx control (without UI) to a ABL (.net) class.

With C# i add a COM reference and then i get a .NET interop assembly.

How to do the same with OEA?

Stefan

All Replies

Posted by Admin on 29-May-2012 08:36

this is the first time i have to add an ocx control (without UI) to a ABL (.net) class.

 

A real Control, not an Automation Server?

How to do the same with OEA?

 

To my knowledge you'll have to add the Active X Control to an ABL window (.w file) and embed that into a GUI for .NET Form using the WindowContainer Control.

Posted by Stefan Marquardt on 29-May-2012 08:47

Mike,

this is the definition of the interop assembly in C#:

namespace

OposScanner_CCO

{

[

CoClass(typeof(OPOSScannerClass))]

[

Guid("CCB95181-B81E-11D2-AB74-0040054C3719")]

public interface OPOSScanner : IOPOSScanner, _IOPOSScannerEvents_Event

{

}

I really don't know the difference, it's an ocx file that has no UI.

Posted by Peter Judge on 29-May-2012 09:41

I had some success using the MS aximp tool to generate C# assemblies, which can then be used in OE. This tool is part of Visual Studio, I believe. Doc at http://msdn.microsoft.com/en-us/library/8ccdh774%28VS.80%29.aspx .

-- peter

Posted by jquerijero on 29-May-2012 16:53

You can also use this trick if you have Visual Studio 6 and later. Create a Visual Studio project add a reference to the OCX, Visual Studio should automatically create a DLL that starts with 'ax'. You can use that DLL like standard .NET assembly.

Posted by Stefan Marquardt on 30-May-2012 00:54

It's sounds like OEA and ABL.NET forgot the support for including ocx components?

Since weeks i am struggling with Honeywell to get  multiple scanner support with OPOS.

Now i got an updated ocx and have to realize that there is no "normal" way to integrate it ..

Posted by Admin on 30-May-2012 01:01

Now i got an updated ocx and have to realize that there is no "normal" way to integrate it ..

 

Since your componen seems to support Events (IOPOSScannerEvents_Event) I guess you'll have to go down the route of using and embedded window here (if you need to react to those events).

The GUI for .NET bridge typically does not support Active X based events, because they typically don't follow the standard .NET convention.

Or you write your own tiny little C# (of VB.NET if you dare) wrapper around it.

This thread is closed