private static void VersionCheck()
 {
     if (ApartmentState.Unknown == Thread.CurrentThread.GetApartmentState())
     {
         SetMTAApartmentState();
     }
     ADP.CheckVersionMDAC(false);
 }
        static private void VersionCheck()
        {
            // $REVIEW: do we still need this?
            // if ApartmentUnknown, then CoInitialize may not have been called yet
            if (ApartmentState.Unknown == Thread.CurrentThread.GetApartmentState())
            {
                SetMTAApartmentState();
            }

            ADP.CheckVersionMDAC(false);
        }
Esempio n. 3
0
        }                              // default const.

        static internal OdbcEnvironmentHandle GetGlobalEnvironmentHandle()
        {
            OdbcEnvironmentHandle globalEnvironmentHandle = _globalEnvironmentHandle as OdbcEnvironmentHandle;

            if (null == globalEnvironmentHandle)
            {
                ADP.CheckVersionMDAC(true);

                lock (_globalEnvironmentHandleLock) {
                    globalEnvironmentHandle = _globalEnvironmentHandle as OdbcEnvironmentHandle;
                    if (null == globalEnvironmentHandle)
                    {
                        globalEnvironmentHandle  = new OdbcEnvironmentHandle();
                        _globalEnvironmentHandle = globalEnvironmentHandle;
                    }
                }
            }
            return(globalEnvironmentHandle);
        }
Esempio n. 4
0
        internal static OdbcEnvironmentHandle GetGlobalEnvironmentHandle()
        {
            OdbcEnvironmentHandle handle = _globalEnvironmentHandle as OdbcEnvironmentHandle;

            if (handle == null)
            {
                ADP.CheckVersionMDAC(true);
                lock (_globalEnvironmentHandleLock)
                {
                    handle = _globalEnvironmentHandle as OdbcEnvironmentHandle;
                    if (handle == null)
                    {
                        handle = new OdbcEnvironmentHandle();
                        _globalEnvironmentHandle = handle;
                    }
                }
            }
            return(handle);
        }