Clarion.NET usage

Hi @Daniel1,

If you’re looking to integrate Clarion with C#, there are ways to achieve this by creating Clarion DLLs that can be called from C# and vice versa. Here are a couple of approaches you might find helpful:

1. Creating Clarion DLLs for C# to Call

You can create native DLLs in Clarion that expose functions callable from C#. By using EXPORT in Clarion, you can define specific functions to be accessed by external applications, including C#. Careful handling of data types and calling conventions is required, but this approach works effectively.

2. Ahead-of-Time (AOT) Compilation for Modern .NET

If you’re working with newer .NET versions, Native AOT compilation allows you to compile .NET code into native binaries. While this approach is primarily for C# development, it can complement Clarion DLLs in a mixed-language project where C# manages higher-level logic.

For older versions of .NET (pre-.NET 8.0), you may need to use Unmanaged Exports to call C# code from Clarion.

Additional Resources

These methods enable you to leverage the strengths of both Clarion and C#, allowing you to reuse existing code while taking advantage of modern frameworks. For more detailed discussions, check out related topics on ClarionHub and refer to the Clarion Help documentation on AttachThreadToClarion() for guidance on threading considerations.

Best regards,
Mark