| View previous topic :: View next topic |
| Author |
Message |
izhelezny
Joined: 26 Jul 2010 Posts: 2
|
Posted: Tue Jul 27, 2010 14:07 UTC Post subject: Calling a VisualAPL dll by other .NET code |
|
|
== 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}
}
}
|
|
| Back to top |
|
 |
joe_blaze
Joined: 11 Feb 2007 Posts: 230 Location: Box 361 Brielle, NJ 08730-0361
|
Posted: Wed Jul 28, 2010 1:32 UTC Post subject: Changing the default Class1 class name |
|
|
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!!!
| Description: |
| A few print screens of elements of the working example |
|
 Download |
| Filename: |
APLPOC1_workingNow.pdf |
| Filesize: |
544.61 KB |
| Downloaded: |
8 Time(s) |
| Description: |
|
 Download |
| Filename: |
APLPOC1.zip |
| Filesize: |
1.19 MB |
| Downloaded: |
8 Time(s) |
_________________ Bringing APL into the .Net mainstream! Ask me about the VisualAPL application software development environment that is fully integrated with Microsoft Visual Studio. |
|
| Back to top |
|
 |
izhelezny
Joined: 26 Jul 2010 Posts: 2
|
Posted: Wed Jul 28, 2010 2:18 UTC Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
joe_blaze
Joined: 11 Feb 2007 Posts: 230 Location: Box 361 Brielle, NJ 08730-0361
|
Posted: Wed Jul 28, 2010 3:44 UTC Post subject: VB.Net code accessing VisualAPL .Net assembly |
|
|
When time permits, please reply with an attachment of your VB.Net code illustrating this. It would be a good example for the forum.
_________________ Bringing APL into the .Net mainstream! Ask me about the VisualAPL application software development environment that is fully integrated with Microsoft Visual Studio. |
|
| Back to top |
|
 |
|