Exemplo n.º 1
0
        private void SetApplication()
        {
            SAPbouiCOM.SboGuiApi oSboGuiApi = null;
            string sConnectionString        = null;

            oSboGuiApi = new SAPbouiCOM.SboGuiApi();

            sConnectionString = System.Convert.ToString(Environment.GetCommandLineArgs().GetValue(1));

            try
            {
                oSboGuiApi.Connect(sConnectionString);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                System.Environment.Exit(0);
            }
            oApplication = oSboGuiApi.GetApplication(-1);

            oApplication.SetStatusBarMessage(string.Format("Addon {0} Conectado com sucesso!!!);",
                                                           System.Windows.Forms.Application.ProductName),
                                             BoMessageTime.bmt_Medium
                                             , false);
        }