如何通过CAPL访问.dll文件? [英] How to access .dll file via CAPL?

查看:947
本文介绍了如何通过CAPL访问.dll文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下代码。

int CAPLEXPORT far CAPLPASCAL capl_visa_init(double arg)
{    
    return visa_init(arg);
}

CAPL_DLL_INFO CAPL_DLL_INFO_LIST[] =
{
    {"my_visa_init", (CAPL_FARCALL)capl_visa_init, 'D', 1, "F", "\000"},
    ....
    {0,0}
}; 

对于此代码,我收到解析错误。我该如何解决?我需要包括头文件吗?

For this code, I get 'Parse error'. How can I resolve it? Do I need to include an header file?

推荐答案

为了使CAPL编译器和CAPL浏览器能够识别DLL,您必须将其链接到CAPL程序。
为此,您可以在CANoe的选项对话框中输入DLL。在这种情况下,该DLL将可用于您拥有的所有CAPL程序。另一方面,您可以使用 #pragma库命令在CAPL程序的include部分中输入DLL。在这种情况下,它将仅可用于该程序。

In order for the CAPL compiler and CAPL browser to recognize the DLL, you must link it to the CAPL program. To do this, you can enter the DLL in the Options dialog in CANoe. In this case, the DLL will be available to all CAPL programs that you have. On the other hand you can enter the DLL in the includes section of a CAPL program using the #pragma library command. In this case, it will only be available to this program.

这篇关于如何通过CAPL访问.dll文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆