从 ASP.NET Web 服务调用 C DLL
编辑问题
嗨,这是这个项目的总工作流程
,我们有一个用 cobol 编写的应用程序,我们可以仅使用 C DLL
与该应用程序进行通信,我们必须在 C DLL
中调用该方法。下面给出了 code>dll
[DllImport(@"C:\CCExpert\haz450cp.dll", EntryPoint = "HAZ450CP", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern void HAZ450CP(ref p45_control p45_controlx, out p45_clreturn p45_clreturnx, ref p45_clclaim p45_clclaimx);
我们所做的就是从 C# DLL
调用 C dll
,这个 C# dll
正在工作对于控制台应用程序来说很好,这意味着我们可以向它提供输入,并且我们也可以从控制台应用程序获得正确的输出。
但是当我尝试从 ASP.NET WebService
调用相同的 C#DLL
时,它给出了错误
选择调试选项后,我会看到另一个窗口,如下面的
谢谢
EDITED QUESTION
Hi this is the total workflow of this project
we have a application which is written in cobol, wee can communicate to that application using only a C DLL
, the method which we have to call in the dll
is given below
[DllImport(@"C:\CCExpert\haz450cp.dll", EntryPoint = "HAZ450CP", CallingConvention = CallingConvention.Cdecl)]
unsafe public static extern void HAZ450CP(ref p45_control p45_controlx, out p45_clreturn p45_clreturnx, ref p45_clclaim p45_clclaimx);
what we did is we are invoking that C dll
from a C# DLL
, this C# dll
working fine with console application, it means we can give the input to it and we are getting proper output also from console application.
But when i try to call the same C#DLL
from the ASP.NET WebService
its giving error
After select the debug option i get another window like fallowing
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这听起来有点愚蠢,但是您的 ASP.NET 用户可以从 DLL 所在的目录中读取内容吗?
您可以通过将 DLL 复制到 Web 应用程序文件夹的 bin 目录并将 DLL 路径从 C:\CCExpert\haz450cp.DLL 更改为 haz450cp.DLL 来执行此测试
I know this might sound a little stupid, but can your asp.net user read contents from the directory where the DLL is located?
You can do this test by copying you DLL to the bin directory of your web application folder and changing the DLL path from C:\CCExpert\haz450cp.DLL to just haz450cp.DLL