10.2.100.16
I’m trying to do a proof of concept to call a function from a C# DLL in an Epicor customization. Below is the DLL source:
using System;
namespace TestLib
{
public class test
{
public int Twice(int a, int b )
{
b = a * 2;
return 0;
}
}
}
The DLL compiles successfully, I’ve copied the DLL to the client folder, added the reference through Assembly Reference Manager, and
refrenced the class in a using reference. Below is the code calling the function:
private void epiButtonC1_Click(object sender, System.EventArgs args)
{
try
{
// ** Place Event Handling Code Here **
EpiNumericEditor numInputParm = (EpiNumericEditor)csm.GetNativeControlReference("3c5949cc-85db-4aee-afb4-e59a22dfbc0b");
EpiNumericEditor numOutputParm = (EpiNumericEditor)csm.GetNativeControlReference("9834feac-aa4d-4fc4-8cda-f746b9cdca74");
int lngOutput = 0;
Test tst = new Test();
int RC = tst.Twice(int.Parse(numInputParm.Text), int lngOutput);
numOutputParm.Text = lngOutput.ToString();
oTrans.Refresh;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
However, when testing the customization, I’m getting errors on the line executing the function:
Compiling Custom Code …
----------errors and warnings------------
Error: CS1525 - line 68 (261) - Invalid expression term ‘int’
Error: CS1002 - line 68 (261) - ; expected
Error: CS1525 - line 68 (261) - Invalid expression term ‘)’
** Compile Failed. **
I’m very new to C# and E10, and I don’t see the issue with the code. Could anyone please help? Thanks!