2
我想通过使用dllexport导出函数。但我遇到的错误,而编译器“错误C4439:‘WrappedC’:在签名托管类型函数定义必须具有__clrcall调用约定”。使用dllexport时出错?
我的头文件(.h)中的代码是:
extern "C"
{
__declspec(dllexport) int __stdcall ABC(int i);
__declspec(dllexport) char* __stdcall C(int i);
__declspec(dllexport) array<char>^ __stdcall WrappedC(int i) ;
}
我曾试图改变_stdcall到__clrcall但它使另一个错误:
error C3395: 'WrappedC' : __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention
我已经搜索互联网,但我对尚未解决。
感谢,
牛逼& T组
谢谢你,但如何解决这个问题。 – TTGroup 2012-03-16 03:01:32
哎呀!我知道我忘了一些东西。您可以将该函数声明为public,但您不能在非托管程序中使用它。 – Aleks 2012-03-16 03:04:29
@Aleks其实,你可以,它只是涉及非常hacky的东西,它是一个封装DLL更容易。 – Avery3R 2012-03-16 03:06:05