Calling a VisualAPL dll by other .NET code

General discussions related to APLNext's VisualAPL.

Moderators: Tech Support, phpbb_admin

Calling a VisualAPL dll by other .NET code

Postby izhelezny » July 27th, 2010, 10:07 am

== reposting from an earlier private message ==

To VisualAPL tech support,
I am trying to do a simple proof of concept with VisualAPL. Following a COM example I was able to make the program below work as a COM object, calling it from APL+Win and VBA. I need to make the same code work calling it as a dll either from C# or VB .NET. Is there an online example of a simple console .NET C# or VB program calling a VisualAPL dll?

#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices

#endregion

namespace APLPOC1{
[Guid("E7BD7ACF-770D-4747-8810-6A61A4DFEC2D")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("APLPOC1")]
public class Circle{
public function double Area(double Radius)
{return ○1×Radius*2}
public function Area_NoStringType(Radius)
{return ○1×Radius*2}
}
}
izhelezny
 

Changing the default Class1 class name

Postby joe_blaze » July 27th, 2010, 9:32 pm

Attached is your project modified so that it now operates properly. Basically I manually modified the Circle class name back to Class1 and re-built the solution. In addition I added a C# console project to the VisualAPL solution to server as an illustrative test harness. This console project shows how the VisualAPL .Net assembly can be used by C# or any other .Net language.

To change the default Class1 class name to Circle, follow the instruction at: http://forum.apl2000.com/viewtopic.php?t=453

I have also attached a pdf-format document which shows various elements of the working project.

Keep those questions coming!!!
Attachments
APLPOC1_workingNow.pdf
A few print screens of elements of the working example
(544.61 KiB) Downloaded 1116 times
APLPOC1.zip
The working example.
(1.19 MiB) Downloaded 1075 times
joe_blaze
 
Posts: 384
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361

Postby izhelezny » July 27th, 2010, 10:18 pm

Thank you!

I actually ended up writing code in VB.NET, and now have yours in C#.NET, which will complete my proof of concept.
izhelezny
 

VB.Net code accessing VisualAPL .Net assembly

Postby joe_blaze » July 27th, 2010, 11:44 pm

When time permits, please reply with an attachment of your VB.Net code illustrating this. It would be a good example for the forum.
joe_blaze
 
Posts: 384
Joined: February 11th, 2007, 3:09 am
Location: Box 361 Brielle, NJ 08730-0361


Return to VisualAPL

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron