Clarion:可以使用 C# 程序集吗?

发布于 2024-07-12 05:58:03 字数 294 浏览 7 评论 0原文

是否可以使用 Clarion 的 C# 程序集? 如果不。 是否可以运行用 C# 编写的简单控制台应用程序并将其输出读回到 Clarion 中? 在这两种情况下,你会怎么做? 对于程序集,您是否需要对其执行一些特殊操作才能让 Clarion 访问它? 在这两种情况下,您将如何在 Clarion 中执行此操作?

原因是我们有两个用 C# 编写的方法,它们由用 C# 编写的应用程序使用。 但我们还需要在 Clarion 应用程序中使用相同的方法。 我们真的不想再次为 Clarion 编写这些方法,因为它们有点复杂......

Is it possible to use a C# assembly from Clarion? If not. Is it possible to run a simple console application written in C# and read the output from it back into Clarion? In both cases, how would you do it? In the case of the assembly, would you have to do something special with it for Clarion to get access to it? In both cases, how would you do it in Clarion?

The reason is we have two methods written in C#, which is used by an application written in C#. But we also need to use that same method in a Clarion application. And we really don't want to write the methods again for Clarion, since they are a bit complex...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

っ左 2024-07-19 05:58:03

除非您需要在 Clarion 程序中显示 .Net UserControl,否则我建议使用此处描述的技术:

Robert Giesecke - 用于非托管导出的 C# 项目模板

在 Clarion 端,您只需链接并使用 .Net 程序集,就像使用任何其他非托管 DLL 一样。 我发现使用 LoadLibrary API 在运行时加载 DLL 也很方便。

Unless you need to display a .Net UserControl in your clarion program I would recommend using the technique described here:

Robert Giesecke - C# Project Template for Unmanaged Exports

On the Clarion side you then just link and use the .Net assembly as you would any other unmanaged DLL. I have found it convenient to load the DLL at runtime with the LoadLibrary API too.

烟火散人牵绊 2024-07-19 05:58:03

Clarion 程序不会轻松或很好地调用 C# DLL,但反之则不一定成立。

在我的一个项目中,我决定使用 TCP/IP 将 Clarion 程序和 C# 程序集之间的耦合降至最低。

这个想法是让 Clarion 程序连接到迷你服务器的侦听端口,发送请求并接收回复,就像使用参数调用函数并接收结果一样。

在 C# 程序集中添加一个类来充当 TCP/IP 服务器很容易。 在 Clarion 方面,有一些提供 TCP/IP 功能的优秀模板。 我们多年来一直使用 CapeSoft 的 NetTalk 模板,它几乎坚如磐石。

根据您的要求的紧急程度,您可以考虑这条路线。

-射线。

A Clarion program will not easily or nicely call a C# DLL, though the reverse is not necessarily true.

In a project of mine, I decided to go with a minimum of coupling between a Clarion program and a C# assembly by using TCP/IP.

The idea is to have the Clarion program connect to the listening port of your mini-server, send a request and receive a reply, in the same way that a function is called with parameters and a result received.

It is easy to add a class in your C# assembly to act as a TCP/IP server. On the Clarion side, there are a handful of good templates that offer TCP/IP functionality. We have been using CapeSoft's NetTalk template for years and it is virtually rock-solid.

Depending on the urgency of your requirement, you might consider this route.

-Ray.

何其悲哀 2024-07-19 05:58:03

什么是歌乐? 它是非托管应用程序吗? 如果是,那么您将对程序集执行的“特殊操作”称为 Com Interop: http://msdn.microsoft.com/en-us/magazine/cc163494.aspx

What is Clarion? Is it an unmanaged application? If it is, then the "something special" you would do to your assembly is called Com Interop: http://msdn.microsoft.com/en-us/magazine/cc163494.aspx

绝不放开 2024-07-19 05:58:03

Clarion 是一种编程语言。 我自己也不知道。 我工作的旧系统的一部分是用它制作的,我们正在努力将其移植到 C# .NET。 所以有一段时间他们不得不并肩生活。 我们找到了解决方法,因此不再需要它。 但感谢您提供的信息:)也许我们以后会需要它。 虽然我希望不是……呵呵。

对于那些好奇的人:en.wikipedia.org/wiki/Clarion_(programming_language)

Clarion is a programming language. Don't know it myself. Parts of the old system where I work is made with it, and we are working on porting it to C# .NET. So for a while they have to live side by side. We found a work around so it is no longer needed though. But thanks for info :) Maybe we will need it further down the road instead. Although I hope not... hehe.

For those curious: en.wikipedia.org/wiki/Clarion_(programming_language)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文