C#调用C++DLL出现外部组件异常 DLL里面有两个函数一个能成功运行一个就提示有错误
C++dllextern"C"{#endifbool__stdcallDownLoadFile(constchar*Url,constchar*Casename,cons...
C++dll
extern "C"
{
#endif
bool __stdcall DownLoadFile(const char* Url, const char* Casename, const char* Filename);
int __stdcall ExecuteFile(const char* hostname);
#ifdef __cplusplus
}
#endif
C#
[DllImport("TCaseDll.dll", CharSet = CharSet.Ansi/*, CallingConvention = CallingConvention.StdCall*/)]
public static extern bool DownLoadFile(string Url, string Casename, string Filename);
[DllImport("TCaseDll.dll", CharSet = CharSet.Ansi/*, CallingConvention CallingConvention.StdCall*/)
public static extern int ExecuteFile(string hostname);
断点调试发现参数都传递正确求高手急啊 展开
extern "C"
{
#endif
bool __stdcall DownLoadFile(const char* Url, const char* Casename, const char* Filename);
int __stdcall ExecuteFile(const char* hostname);
#ifdef __cplusplus
}
#endif
C#
[DllImport("TCaseDll.dll", CharSet = CharSet.Ansi/*, CallingConvention = CallingConvention.StdCall*/)]
public static extern bool DownLoadFile(string Url, string Casename, string Filename);
[DllImport("TCaseDll.dll", CharSet = CharSet.Ansi/*, CallingConvention CallingConvention.StdCall*/)
public static extern int ExecuteFile(string hostname);
断点调试发现参数都传递正确求高手急啊 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询