2
我需要从C#调用C++ API。我已经能够调用API,但char []参数似乎没有正确编组。 这里的C++签名:需要连接到C++ DLL
Create2ptModel(double modelPowers[2],
double modelDacs[2],
int pclRange[2],
double targetPowers[32],
double *dacAdjustFactor,
unsigned short powerRampFactors[32],
BOOL bPCLDacAdjusted[32],
char calibrationModel[32],
char errMsg[1024])
,这是我正在试图把它从C#
[DllImport("AlgorithmsLib.dll", EntryPoint = "[email protected]",
ExactSpelling = true, CallingConvention = CallingConvention.StdCall,
CharSet = CharSet.Auto)]
private static extern AlgorithmStatus Create2ptModel(
double[] modelPowers,
double[] modelDacs,
int[] pclRange,
double[] targetPowers,
ref double dacAdjustFactor,
ushort[] powerRampFactors,
bool[] bPCLDacAdjusted,
/**/char[] calibrationModel,
char[] errMsg/**/);
,我可以马歇尔如何正确任何想法? 在此先感谢!
这两个星号在C#中的calibrationModel的左边是一个错字吗? – 2010-05-05 16:02:47
我觉得他试图强调他们。我已经格式化了代码。 – 2010-05-05 16:03:54