1 Reply Latest reply on Oct 20, 2010 9:07 AM by shawn.bowne

    Trying to create a bridge between application and programmer device.

    shawn.bowne

       Hi, I'm trying to use the ActiveX control in C# to create the bridge between the app and programmer. I imported the control and pasted this code in from the document: http://www.cypress.com/?docID=22268

         
         

      It's giving me a warning about the namespace "USB2IICcom_EXEClass" and saying it cannot be found. Any ideas on why this won't work?

         
         


         

      using System;

         
         

      using System.Collections.Generic;

         
         

      using System.ComponentModel;

         
         

      using System.Data;

         
         

      using System.Drawing;

         
         

      using System.Linq;

         
         

      using System.Text;

         
         

      using System.Windows.Forms;

         
         

      using System.Diagnostics;

         
         

      using USB2IIC;

         
         

       

         
         

      namespace WindowsFormsApplication1

         
         

      {

         
         

          public partial class Form1 : Form

         
         

          {

         
         

              USB2IICcom_EXEClass Bridge;

         
         

              public Form1()

         
         

              {

         
         

                  InitializeComponent();

         
         

              }

         
         

              private void buttonConnect_Click(object sender, EventArgs e)

         
         

              {

         
         

                  if (Bridge != null) return; // Bridge is already connected

         
         

                  // Create Bridge Instance

         
         

                  Bridge = new USB2IICcom_EXEClass();

         
         

                  // Connect Events

         
         

                  Bridge.BridgeConnected = OnBridgeConnect;

         
         

                  Bridge.BridgeDisconnected = OnBridgeDisconnect;

         
         

                  // Start USB Communication

         
         

                  Bridge.InitUSB2IIC(Process.GetCurrentProcess().Id);

         
         

              }

         
         

              private void buttonDisconnect_Click(object sender, EventArgs e)

         
         

              {

         
         

                  Bridge = null;

         
         

                  GC.GetTotalMemory(true);

         
         

              }

         
         

              private void OnBridgeConnect(string BridgeID, string str)

         
         

              {

         
         

                  MessageBox.Show("Connected: " BridgeID);

         
         

              }

         
         

              private void OnBridgeDisconnect(string BridgeID)

         
         

              {

         
         

                  MessageBox.Show("Disconnected: " BridgeID);

         
         

              }

         
         

          }

         
         

      }