|
现在是想在labwindows中生成dll,里面包含一个函数,在labview中通过CLF调用dll中的这个函数。问题是我生成dll后,在labview中的clf节点中,选中该dll后,下面的函数名列表时灰色的,无法使用该函数。
我的labwindows工程包含两个文件:xu.c 和 xu.h。
其中xu.h中的代码如下 :
#ifdef _XU_H_
#define _XU_H_
#include "cvidef.h"
int __stdcall testFun(int x);
#endif
xu.c中的代码如下:
#include <utility.h>
#include "xu.h"
int y=10;
int __stdcall testFun(int x)
{
return y;
}
int __stdcall DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
if (InitCVIRTE (hinstDLL, 0, 0) == 0)
return 0; /* out of memory */
break;
case DLL_PROCESS_DETACH:
CloseCVIRTE ();
break;
}
return 1;
}
int __stdcall DllEntryPoint (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
/* Included for compatibility with Borland */
return DllMain (hinstDLL, fdwReason, lpvReserved);
}
大家看看到底是怎么回事?是我的代码有问题,还是labwindows环境设置有问题,该设置的地方我没有设置好。。。
谢谢!
|
|