从Oracle Forms中的DLL(c#)调用函数

我在Oracle Forms 6i中从DLL调用方法时遇到了很大的问题。 DLL已写入

C#,它是代码:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using OnlineFPCommon; using System.Windows.Forms; namespace TestNamespace { public class TestClass { public static void testMethod() { MessageBox.Show("testMethod"); } } } 

我尝试使用Oracle Forms代码调用它:

 testlib_lhandle := Ora_Ffi.Load_library('C:\libdir\','test.dll'); getresult_fhandle := ora_ffi.register_function(testlib_lhandle,'testMethod'); 

但第二行,当我尝试注册function失败。 为什么? 我该如何正确调用该function?

register_function需要一个dll入口点,您无法在托管代码中生成它。

您可以编写C ++ / CLi包装器DLL以获取托管代码的本机入口点,但如果您只是从头开始,那么为什么不编写一个普通的本机DLL。