예제 #1
0
파일: Main.cs 프로젝트: andreyks95/Studing
 private static void OnStop()
 {
     if (_cookie != 0)
     {
         ComAPI.CoRevokeClassObject(_cookie);
     }
 }
예제 #2
0
파일: Main.cs 프로젝트: andreyks95/Studing
        private static void OnStart()
        {
            Guid   CLSID_MyObject = new Guid(Server.Guid);
            UInt32 hResult        = ComAPI.CoRegisterClassObject(ref CLSID_MyObject, new ClassFactory(),
                                                                 ComAPI.CLSCTX_LOCAL_SERVER, ComAPI.REGCLS_MULTIPLEUSE, out _cookie);

            if (hResult != 0)
            {
                throw new ApplicationException(
                          "CoRegisterClassObject failed" + hResult.ToString("X"));
            }
            else
            {
                Console.WriteLine("CoRegisterClassObject successfully!");
            }
        }