Dotnet DLL

Posted by Jens Dahlin on 10-Jan-2012 07:19

I'm looking into a new API for Point-of-Sale terminals. I've been given a (somewhat lousy) API documentation and a couple of dotnet dlls.

This dll is supposed to have a number of entry points, however when I do this:

PROCEDURE Open EXTERNAL "baxi_dotnet.dll".

END.

RUN Open.

I get error 3260 (Cannot find entry point). I've tried Open, OPEN, open etc since it's supposed to be case sensitive. I've also tried a couple of other procedures.

The big question is: how do I know if the dll is ABL compatible? I'm on Windows 7, Appbuilder, 10.2B03.

/Jens

All Replies

Posted by Admin on 10-Jan-2012 07:29

10.2B hat much bettet support for .NET that declaring it as an External procedure.

Check the GUI for .NET documentation on how to add it as an Assembly.

No OO required, works with AppBuilder and Procedure Editor as well. However more fun in OpenEdge Architect

Posted by Jens Dahlin on 10-Jan-2012 08:07

Does that apply even though this isn't a GUI dll? It's just to handle calls to a payment terminal.

Posted by Peter Judge on 10-Jan-2012 08:14

Yep, the restrictions on only using GUI DLLs were lifted on the 10.2B time frame (I don't remember exactly when; no doubt Mike does ).

Copy the DLL to your project in OE Architect and add the reference to the project (via right-click on existing references in the project outline, or through the OE menu). If the icon in the references doesn't have a red X you should be OK.

-- peter

Posted by Admin on 10-Jan-2012 08:14

Yes

Posted by Jens Dahlin on 10-Jan-2012 08:25

I'm on AppBuilder though.

Posted by Peter Judge on 10-Jan-2012 08:33

Jens@airtours.se wrote:

I'm on AppBuilder though.

OE uses a file called assemblies.xml in a folder indicated by the -assemblies startup parameter (defaults to working dir) to link (in a sense) to the assemblies it uses. You can add assemblies to a file by using the Update Assembly references tool in $DLC\bin. I don't see it on a menu outside of Architect so try running it from the command line: UpdAsmRef.exe (if it's not there I'd consider logging a bug).

Once you've added your assembly you can start an OE (AppBuilder) session and try to interact with the DLL.

-- peter

Posted by Jens Dahlin on 11-Jan-2012 04:00

I thought the old way of calling dlls was tricky but this is worse...

I've added the dll to the assemblies.xml and a startup parameter -assemblies to it's location. (I've also put the dll in the working directory plus systems32 - just to be safe).

After that I'm getting nowhere. Using a third party application I've checked the dll and found a namespace BBS.BAXI containing a class BaxiCtrl.

BaxiCtrl contains all the methods listed in the documentation (Open, Close, TransferAmount etc).

So using my old old OO-knowledge, Im guessing I should do something like:

USING BBS.BAXI.*.

DEFINE VARIABLE BaxiControl AS CLASS BaxiCtrl NO-UNDO.

However the DEFINE statement generates error 14081 (.net runtime error) and 12886 (Cannot find class or interface) (My messages are in Swedish so translation might not be 100% accurate).

Checking the public knowledgebase (utterly broken since the new layout by the way) reveals a possible trust error if you have a shared network installation. I have a local installation so that doesn't sound quite right.

Im just trying to do this in a simple procedure by the way.

Posted by Shelley Chase on 12-Jan-2012 11:56

Hi Jens,

Is this an ActiveX dll? If it is you cannot load it using .NET. This is Microsoft behavior that the CLR only works with .NET dlls. They do have some COM interop libraries but I do not know much about it. -Shelley

Posted by Jens Dahlin on 13-Jan-2012 00:42

According to documentation it's a .net dll.

I can mention that I get the errors I listed above whenever I try any .net example code.

/Jens

Posted by Admin on 13-Jan-2012 00:53

What's the .NET Framework version required by the DLL (should be part of the documentation).

You're on 10.2 - that supports .NET Framework's 2.0 and 3.x

Only OE11 does support .NET 4.0

Can you run:

MESSAGE System.Environment:SystemDirectory

    VIEW-AS ALERT-BOX INFO BUTTONS OK.

Just to test, that a simple .NET sample code works fine? That's from a core .NET Assembly, so does not require the assemblies.xml file.

Posted by Jens Dahlin on 13-Jan-2012 01:02

I can't run it. Same error as above (14081). Checked on another computer and there it works so it might be a local error.

From the documentation:

BAXI is a .NET dll.
Supported environments:
  • .NET 3.5
  • .NET micro 4.1
  • Mono (Linux)

Posted by Admin on 13-Jan-2012 01:41

Jens@airtours.se schrieb:

I can't run it. Same error as above (14081). Checked on another computer and there it works so it might be a local error.

Time to report it to tech support - they might have a list to check your environment. Making sure, that .NET 3.5 is propertly installed would be a good start.

From the documentation:

BAXI is a .NET dll.
Supported environments:
  • .NET 3.5
  • .NET micro 4.1
  • Mono (Linux)

That looks o.k.

This thread is closed