Example #1
0
        public void ReleaseComObject()
        {
            if (this.HasComObject())
            {
                Marshal.FinalReleaseComObject(this.comObject);
            }

            this.comObject = null;
        }
Example #2
0
        private bool TryLoadComObject()
        {
            try
            {
                this.comObject = (LT_VBCOMLib.Application)Interaction.GetObject(null, "LT_VBCOM.Application");

                if (!this.HasComObject())
                {
                    return(false);
                }
            }
            catch
            {
                return(false);
            }

            //常にエラーを抑制したいので、必ず最初に呼ばれるここでエラー表示を設定している
            this.SetErrorType(1);

            return(true);
        }