Example #1
0
            public void CreateInstance(
                [MarshalAs(UnmanagedType.Interface)] object pUnkOuter,
                ref Guid riid,
                [MarshalAs(UnmanagedType.Interface)] out object ppvObject)
            {
                BasicClassFactory.ValidateInterfaceRequest(_classType, ref riid, pUnkOuter);

                ppvObject = Activator.CreateInstance(_classType);
                if (pUnkOuter != null)
                {
                    ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject);
                }
            }
Example #2
0
            private void CreateInstanceInner(
                object pUnkOuter,
                ref Guid riid,
                string key,
                bool isDesignTime,
                out object ppvObject)
            {
                BasicClassFactory.ValidateInterfaceRequest(_classType, ref riid, pUnkOuter);

                ppvObject = _licenseProxy.AllocateAndValidateLicense(_classType, key, isDesignTime);
                if (pUnkOuter != null)
                {
                    ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject);
                }
            }
Example #3
0
            public void CreateInstance(
                [MarshalAs(UnmanagedType.Interface)] object?pUnkOuter,
                ref Guid riid,
                [MarshalAs(UnmanagedType.Interface)] out object?ppvObject)
            {
                Type interfaceType = BasicClassFactory.GetValidatedInterfaceType(_classType, ref riid, pUnkOuter);

                ppvObject = Activator.CreateInstance(_classType) !;
                if (pUnkOuter != null)
                {
                    ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject);
                }

                BasicClassFactory.ValidateObjectIsMarshallableAsInterface(ppvObject, interfaceType);
            }
Example #4
0
            private void CreateInstanceInner(
                object?pUnkOuter,
                ref Guid riid,
                string?key,
                bool isDesignTime,
                out object ppvObject)
            {
                Type interfaceType = BasicClassFactory.GetValidatedInterfaceType(_classType, ref riid, pUnkOuter);

                ppvObject = _licenseProxy.AllocateAndValidateLicense(_classType, key, isDesignTime);
                if (pUnkOuter != null)
                {
                    ppvObject = BasicClassFactory.CreateAggregatedObject(pUnkOuter, ppvObject);
                }

                BasicClassFactory.ValidateObjectIsMarshallableAsInterface(ppvObject, interfaceType);
            }