Getting started using Visual C#

  1. Select menu-[File]-[New]-[Project] in Visual Studio .NET.
  2. Select the following type for the Visual C# project.
  • .NET Framework : "Windows Forms App (.NET Framework)"
  • .NET6 : "Windows Forms App"
  1. Select [Project]-[Add Reference].
  2. In the [Browse] tab, select the "RCAPINt2.dll" file under the "\API" directory.
  • .NET Framework : \Assembly\net462
  • .NET6 : \Assembly\net6.0-windows
  1. In the Form1 class, declare a Spel class variable as shown below.
    private RCAPINet.Spel m_spel;  
    
  2. In the Form_Load event, add initialization code, as shown below.
    private void Form1_Load(object sender, EventArgs e)  
    {  
       m_spel = new RCAPINet.Spel();  
       m_spel.Initialize();  
    
       m_spel.Project =         
    "c:\\EpsonRC80\\projects\\API_Demos\\Demo1\\demo1.sprj";  
    
    m_spel.EventReceived += new  
       RCAPINet.Spel.EventReceivedEventHandler(m_spel_EventReceived);  
    
  3. Add the event handler, as shown below.
    public void m_spel_EventReceived(object sender,  
       RCAPINet.SpelEventArgs e)  
    {  
    }  
    

KEY POINTS


When your application exits, you need to execute Dispose for each Spel class instance. This can be done in your main form's FormClosed event. If Dispose is not executed, the application will not shutdown properly.

m_spel.Dispose();