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