상속: System.Windows.Forms.UserControl, IXApi, IObjectSafety
예제 #1
0
파일: XApiCom.cs 프로젝트: mlken/XAPI2
        public override void virtual_CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject)
        {
            Console.WriteLine("SimpleCOMObjectClassFactory.CreateInstance().");
            Console.WriteLine("Requesting Interface : " + riid.ToString());

            if (riid == Marshal.GenerateGuidForType(typeof(IXApi)) ||
                riid == ManagedCOMLocalServer.IID_IDispatch ||
                riid == ManagedCOMLocalServer.IID_IUnknown)
            {
                XApiCom SimpleCOMObject_New = new XApiCom();

                ppvObject = Marshal.GetComInterfaceForObject(SimpleCOMObject_New, typeof(IXApi));
            }
            else
            {
                throw new COMException("No interface", unchecked ((int)0x80004002));
            }
        }
예제 #2
0
파일: XApiCom.cs 프로젝트: QuantBox/XAPI2
        public override void virtual_CreateInstance(IntPtr pUnkOuter, ref Guid riid, out IntPtr ppvObject)
        {
            Console.WriteLine("SimpleCOMObjectClassFactory.CreateInstance().");
            Console.WriteLine("Requesting Interface : " + riid.ToString());

            if (riid == Marshal.GenerateGuidForType(typeof(IXApi)) ||
                riid == ManagedCOMLocalServer.IID_IDispatch ||
                riid == ManagedCOMLocalServer.IID_IUnknown)
            {
                XApiCom SimpleCOMObject_New = new XApiCom();

                ppvObject = Marshal.GetComInterfaceForObject(SimpleCOMObject_New, typeof(IXApi));
            }
            else
            {
                throw new COMException("No interface", unchecked((int)0x80004002));
            }
        }