Earth calling .NET stars... .Exe in vb project

Posted by OctavioOlguin on 22-Apr-2015 16:29

Greetings all...

I wonder if someone could help me with one questions about .NET....

I'm connecting ABL to an accounting software.

1) I have documentation of that product that states this, for doing what I need to do, example:

Add reference library to project by defining SDKCONTPAQNG.EXE in <c:\program files\Compac\SDK>

and once defined, create objects:

Dim lSDPoliza As SDKCONTPAQNGLib.TSdkPoliza = New SDKCONTPAQNGLib.TSdkPoliza

static TSdkPoliza lSdkPoliza = new TSdkPoliza();

and then fill data:

lSdkPoliza.IniciarInfo();

lSdkPoliza.Tipo = SDKCONTPAQNGLib.ETIPOPOLIZA.TIPO_INGRESOS
;

lSdkPoliza.Impresa = 0;
lSdkPoliza.Guid = SDK_GUID.New().ToUpper();

This is in vb.net, or C#.     How would it be writen in ABL?

I'll use the handbook ".NET Mapping Reference", the problem comes with the first step, the sdk documentation   gives instruction to integrate the .EXE file to the vb project...  what means that in ABL world?

Thanks..




All Replies

Posted by Mike Fechner on 22-Apr-2015 20:32
That would be adding the file to assemblies.xml. But I guess you will not have any luck here. To my knowledge OpenEdge does not support loading .exe file assemblies.

Check the section about managing assembly references in the GUI for .NET programming reference.

When I am right you will have to use visual studio to create a .dll file assembly first by creating a class library which then references your .exe

Von meinem Windows Phone gesendet

Von: OctavioOlguin
Gesendet: ‎23.‎04.‎2015 00:30
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] Earth calling .NET stars...   .Exe in vb project

Thread created by OctavioOlguin

Greetings all...

I wonder if someone could help me with 2 questions about .NET....

I'm connecting ABL to an accounting software.

1) I have documentation of that product that states this, for doing what I need to do, example:

Add reference library to project by defining SDKCONTPAQNG.EXE in <c:\program files\Compac\SDK>

and once defined, create objects:

Dim lSDPoliza As SDKCONTPAQNGLib.TSdxPoliza = New SDKCONTPAQNGLib.TSdkPoliza

static TSdkPoliza lSdkPoliza = new TSdkPoliza();

and then fill data:

lSdkPoliza.IniciarInfo();

lSdkPoliza.Tipo = SDKCONTPAQNGLib.ETIPOPOLIZA.TIPO_INGRESOS
;
lSdkPoliza.Impresa = 0;
lSdkPoliza.Guid = SDK_GUID.New().ToUpper();

This is in vb.net, or C#.     How would it be writen in ABL?

I'll use the handbook ".NET Mapping Reference", the problem comes with the first step, the sdk documentation   gives instruction to integrate the .EXE file to the vb project...  what means that in ABL world?

Thanks..




Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Frank Meulblok on 23-Apr-2015 03:34

"That would be adding the file to assemblies.xml. But I guess you will not have any luck here. To my knowledge OpenEdge does not support loading .exe file assemblies."

In my OE 11.5, assembly references tools *do* allow specifing an .exe as Local Assembly.

I don't know it it actually works though, this is the first time I actually see someone exposing assemblies from the executable instead of from a .dll.

Posted by Garry Hall on 23-Apr-2015 07:30

If the fully qualified assembly name is in the assemblies.xml file, the AVM should support whatever Assembly.Load(AssemblyName), Assembly.Load(String) and Assembly.LoadFrom(String) supports. It calls into the CLR for loading assemblies, using these three static methods on Assembly.

Posted by OctavioOlguin on 24-Apr-2015 14:46

Could I provide the .exe file to see if someone could define it on a project, as I can't define it on the assemblies widow of my projects....?

Posted by OctavioOlguin on 24-Apr-2015 15:42

Hey Mike....

That thing you said..

"When I am right you will have to use visual studio to create a .dll file assembly first by creating a class library which then references your .exe ", is easy to accomplish?

TIA

Posted by Mike Fechner on 26-Apr-2015 16:55
It's not rocket science. But you will need to know how to code a little bit C# and use the Visual Studio.

But as there were some opinions on this thread that .exe Assemblies should work, you might try to open a tech support call to get that issue resolved.

Von Outlook gesendet




[collapse]
On Fri, Apr 24, 2015 at 1:43 PM -0700, "OctavioOlguin" <bounce-OctavioOlguin@community.progress.com> wrote:

Reply by OctavioOlguin

Hey Mike....

That thing you said..

"When I am right you will have to use visual studio to create a .dll file assembly first by creating a class library which then references your .exe ", is easy to accomplish?

TIA

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
Posted by Garry Hall on 26-Apr-2015 20:58

If I understand Frank's response correctly, you can put the .exe reference into assemblies.xml. If you can do that, try a simple .p with the following code:

USING SDKCONTPAQNGLib.

DEF VAR lSdkPoliza as TSdkPoliza NO-UNDO.

If this compiles, then the AVM can load and use the .exe assembly.

Posted by OctavioOlguin on 27-Apr-2015 10:16

Let's see how is it going...

This is assemblies:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<references>
<assembly name="sdk\SDKCONTPAQNG.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</references>

and this is a test:

USING SDKCONTPAQNGLib.*.
DEF VAR lSdkPoliza AS TSdkPoliza NO-UNDO.

MESSAGE "OK!"
VIEW-AS ALERT-BOX.

PDSOE won't complain on sintax nor dependencies, and it compiled and created a .r and run without any error, just the message...

I guess with are lucky so far, don't you think?

I'll do testing and document on blog, as I bet this is solid gold to developers here in Mexico.

This thread is closed