Saturday, 11 June 2022
  1 Replies
  1.1K Visits
Hello EBDN community,

C# COM intetface Error.

I tried to run this Code, but always Error. The error is "Parameter is not valid,(From HRESULT:0x80070057(E INVALIDARG)


// C# COM intetface Error.
// ref Interop.Aucotec.dll
// using Aucotec;

AucExecuteSheetOperationRecord[] atParamData = new AucExecuteSheetOperationRecord[9];

atParamData[0].qual = (int)AucExecuteSheetModes.aucOpExecSheetGetSymbol;

atParamData[1].qual = (int)AucExecuteSheetModes.aucArgExecSheetRef2Symbol;
atParamData[1].val = symbolId;

atParamData[2].qual = (int)AucExecuteSheetModes.aucArgExecSheetFctSel;
atParamData[2].val = 0;

atParamData[3].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: symbol position left top (X)
atParamData[4].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: symbol position left top (Y)
atParamData[5].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: symbol position right bottom (X)
atParamData[6].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: symbol position right bottom (Y)
atParamData[7].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: pin count
atParamData[8].qual = (int)AucExecuteSheetModes.aucArgExecSheetRetVal;//return value: array with pin information

Array myArr = atParamData as Array;
sheet.ExecuteSheetOperation(ref myArr);
catch (Exception ex)
//Forms.MessageBox.Show("ExecuteSheetOperation Error:" + ex.Message);
return null;