//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // NotationFile::NotationFile( const char *file_name, Type type ): m_pages(NULL) { Check_Pointer(this); Check_Pointer(file_name); // //----------------------------------------- // See if we need to read stuff from a file //----------------------------------------- // FileStream file_stream; if (gos_DoesFileExist(file_name)) { file_stream.Open(file_name); m_fileName = file_stream.GetFileName(); m_fileDependencies.AddDependency(&file_stream); } else m_fileName = file_name; // //--------------------------------------------------------------- // Set up the file dependencies, and finish constructing the file //--------------------------------------------------------------- // m_type = type; CommonConstruction(&file_stream, NULL); // //----------------------------------------------------------- // Make sure that we don't allow a non-empty file to be empty //----------------------------------------------------------- // if (m_type==NonEmpty && IsEmpty()) STOP(("%s cannot be empty!", file_name)); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // DatabaseHandle::DatabaseHandle( const char* filename, bool read_only ) { // //----------------------------------------------------- // Create the database heap if it doesn't already exist //----------------------------------------------------- // m_fileName = filename; if (!Database::FilesOpened++) Database_Heap = gos_CreateMemoryHeap("Database", 0); gos_PushCurrentHeap(Database_Heap); m_currentRecord = 0; m_currentPointer = NULL; m_dirtyFlag = false; // //-------------------------------------------- // If the file is read only, our job is simple //-------------------------------------------- // m_readOnly = read_only; if (m_readOnly) { if (gos_DoesFileExist(filename)) { FileStream::IsRedirected = false; DWORD size; m_handle = gos_OpenMemoryMappedFile( filename, reinterpret_cast<BYTE**>(&m_dataBase), &size ); if (m_dataBase->m_tag != Database::e_Tag) STOP(("Invalid database file \"%s\"", filename)); if (m_dataBase->m_version > Database::e_Version) STOP(("Application must be recompiled to use database \"%s\"", filename)); m_baseAddress = reinterpret_cast<DWORD>(m_dataBase); Check_Object(m_dataBase); } else STOP(("Database \"%s\" does not exist", filename)); } // //------------------------------------------------------------- // The file is not read only, so see if we load it or create it //------------------------------------------------------------- // else { m_handle = NULL; if (gos_DoesFileExist(filename)) { DWORD size; gos_GetFile( filename, reinterpret_cast<BYTE**>(&m_dataBase), &size ); FileStream::IsRedirected = false; Check_Pointer(m_dataBase); if (m_dataBase->m_tag != Database::e_Tag || m_dataBase->m_version > Database::e_Version || m_dataBase->m_version == 1) { gos_Free(m_dataBase); PAUSE(("Bad database file! Press 'Continue' to rebuild", filename)); m_dataBase = new(gos_Malloc(sizeof(Database), Database_Heap)) Database; m_baseAddress = 0; } else { m_baseAddress = reinterpret_cast<DWORD>(m_dataBase); Check_Object(m_dataBase); } } // //------------------------------------------ // The file doesn't exist, so create it here //------------------------------------------ // else { m_dataBase = new(gos_Malloc(sizeof(Database), Database_Heap)) Database; m_baseAddress = 0; } } gos_PopCurrentHeap(); }
/// <summary> /// <c>InitLibraries</c> /// </summary> /// <remarks> /// </remarks> /// <returns></returns> void __stdcall InitLibraries(void) { PCSTR pszFormat; PCSTR pszMessage; size_t nBufferSize; char szAssetsPathMessage[MAX_PATH * 2]; bool bbladepath1; bool bbladepath2; // char szDdrawMessage[MAX_PATH * 2]; char szDirectXVersionMessage2[128]; char szDirectXVersionMessage1[128]; char szDsetupMessage[MAX_PATH * 2]; HMODULE hModule_dsetup; char szAssetsPath[MAX_PATH]; PDIRECTXSETUPGETVERSION pDirectXSetupGetVersion; #if _CONSIDERED_OBSOLETE OSVERSIONINFOA VersionInformation; char szDirBuffer[MAX_PATH]; char szInstallMessage[256]; #endif gos_MathExceptions(false, false); // C6031: Return value ignored: 'CoInitialize' CoInitialize(nullptr); // dsetup.dll strcpy_s(szAssetsPath, _countof(szAssetsPath), AssetsDirectory2); strcat_s(szAssetsPath, _countof(szAssetsPath), "\\dsetup.dll"); hModule_dsetup = LoadLibraryA(szAssetsPath); if (hModule_dsetup == nullptr) { strcpy_s(szAssetsPath, _countof(szAssetsPath), AssetsDirectory1); strcat_s(szAssetsPath, _countof(szAssetsPath), "\\assets\\binaries\\dsetup.dll"); hModule_dsetup = LoadLibraryA(szAssetsPath); if (hModule_dsetup == nullptr) { // pszFormat = gos_GetResourceString(gLanguageDLL, 10051u); pszFormat = "Cannot find dsetup.dll in %s\\assets\\binaries or %s, " "this file is required"; sprintf_s(szDsetupMessage, _countof(szDsetupMessage), pszFormat, AssetsDirectory1, AssetsDirectory2); MessageBoxA(nullptr, szDsetupMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } pDirectXSetupGetVersion = reinterpret_cast<PDIRECTXSETUPGETVERSION>( GetProcAddress(hModule_dsetup, "DirectXSetupGetVersion")); if (pDirectXSetupGetVersion == nullptr || pDirectXSetupGetVersion(&DXdwVersion, &DXdwRevision) == 0) { DXdwVersion = 0; DXdwRevision = 0; } FreeLibrary(hModule_dsetup); // ddraw.dll if (gDirectX7) { if ((WindowsNT == false) && ((DXdwVersion < 7) || ((DXdwVersion == 7) && (DXdwRevision < 716)))) { pszFormat = "Requires DirectX 7.0a or later, found %s"; pszMessage = GetDirectXVersion(); sprintf_s(szDirectXVersionMessage1, _countof(szDirectXVersionMessage1), pszFormat, pszMessage); MessageBoxA(nullptr, szDirectXVersionMessage1, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } else { if ((DXdwVersion < 8) || ((DXdwVersion == 8) && (DXdwRevision < 400))) { // pszFormat = gos_GetResourceString(gLanguageDLL, 10030u); // // language.dll : "Requires DirectX 8 or later, found %s" pszFormat = "Requires DirectX 8 or later, found %s"; pszMessage = GetDirectXVersion(); sprintf_s(szDirectXVersionMessage2, _countof(szDirectXVersionMessage2), pszFormat, pszMessage); MessageBoxA(nullptr, szDirectXVersionMessage2, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } if (gNoBlade == true) { LibBlade = LoadLibraryA("ddraw.dll"); if (LibBlade == nullptr) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10031u); pszMessage = "Cannot find ddraw.dll, this file is required"; // sprintf_s(szDdrawMessage, _countof(szDdrawMessage), pszMessage); MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } _DirectDrawCreateEx = reinterpret_cast<PDIRECTDRAWCREATEEX>(GetProcAddress(LibBlade, "DirectDrawCreateEx")); _DirectDrawEnumerate = reinterpret_cast<PDIRECTDRAWENUMERATEA>( GetProcAddress(LibBlade, "DirectDrawEnumerateA")); _DirectDrawEnumerateEx = reinterpret_cast<PDIRECTDRAWENUMERATEEXA>( GetProcAddress(LibBlade, "DirectDrawEnumerateExA")); g_pGetDXVB = nullptr; if ((_DirectDrawCreateEx == nullptr) || (_DirectDrawEnumerate == nullptr) || /* typo bug (_DirectDrawEnumerate == nullptr)*/ (_DirectDrawEnumerateEx == nullptr)) { pszMessage = "Cannot find ddraw functions"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } else { // this special dll must surely be considered obsolete whatever the // advantages there were to use a custom ddraw library. bbladepath2 = false; bbladepath1 = true; strcpy_s(BladePath, _countof(BladePath), AssetsDirectory2); strcat_s(BladePath, _countof(BladePath), "\\bladed.dll"); LibBlade = LoadLibraryA(BladePath); if (LibBlade == nullptr) { strcpy_s(BladePath, _countof(BladePath), AssetsDirectory1); strcat_s(BladePath, _countof(BladePath), "\\assets\\binaries\\bladed.dll"); LibBlade = LoadLibraryA(BladePath); if (LibBlade == nullptr) { if (strlen(AssetsDirectory2) >= 16) { nBufferSize = strlen(AssetsDirectory2); if (!_strnicmp( &AssetsDirectory2[nBufferSize - 16], "\\assets\\binaries", 0x10u)) bbladepath2 = true; } bbladepath1 = false; strcpy_s(BladePath, _countof(BladePath), AssetsDirectory2); strcat_s(BladePath, _countof(BladePath), "\\blade.dll"); LibBlade = LoadLibraryA(BladePath); if (LibBlade == nullptr) { strcpy_s(BladePath, _countof(BladePath), AssetsDirectory1); strcat_s(BladePath, _countof(BladePath), "\\assets\\binaries\\blade.dll"); LibBlade = LoadLibraryA(BladePath); bbladepath2 = true; if (LibBlade == nullptr) { // pszFormat = gos_GetResourceString(gLanguageDLL, // 10033u); pszFormat = "Cannot find blade.dll in " "%s\\assets\\binaries or %s, this file is " "required"; sprintf_s(szAssetsPathMessage, _countof(szAssetsPathMessage), pszFormat, AssetsDirectory1, AssetsDirectory2); MessageBoxA( nullptr, szAssetsPathMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } } } if ((bbladepath2 == false) && _stricmp(ApplicationName, "Test Blade")) { if (bbladepath1 == true) { if (InternalFunctionPause("Warning, '%s' was used", BladePath)) ENTER_DEBUGGER; } else { if (gos_DoesFileExist("assets\\binaries") && InternalFunctionPause("Warning, '%s' was used", BladePath)) ENTER_DEBUGGER; } } _DirectDrawCreateEx = reinterpret_cast<PDIRECTDRAWCREATEEX>(GetProcAddress(LibBlade, "DirectDrawCreateEx")); _DirectDrawEnumerate = reinterpret_cast<PDIRECTDRAWENUMERATEA>( GetProcAddress(LibBlade, "DirectDrawEnumerateA")); _DirectDrawEnumerateEx = reinterpret_cast<PDIRECTDRAWENUMERATEEXA>( GetProcAddress(LibBlade, "DirectDrawEnumerateExA")); g_pGetDXVB = reinterpret_cast<GETDXFUNC>(GetProcAddress(LibBlade, "GetDXVB")); if ((_DirectDrawCreateEx == nullptr) || (_DirectDrawEnumerate == nullptr) || /* typo bug (_DirectDrawEnumerate == nullptr)*/ (_DirectDrawEnumerateEx == nullptr) || (g_pGetDXVB == nullptr)) { pszMessage = "Cannot find Blade functions"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } // ijl10.dll strcpy_s(szAssetsPath, _countof(szAssetsPath), AssetsDirectory2); strcat_s(szAssetsPath, _countof(szAssetsPath), "\\ijl10.dll"); LibJpeg = LoadLibraryA(szAssetsPath); if (LibJpeg == nullptr) { strcpy_s(szAssetsPath, _countof(szAssetsPath), AssetsDirectory1); strcat_s(szAssetsPath, _countof(szAssetsPath), "\\assets\\binaries\\ijl10.dll"); LibJpeg = LoadLibraryA(szAssetsPath); } if (LibJpeg) { _ijlInit = reinterpret_cast<PIJLINIT>(GetProcAddress(LibJpeg, "ijlInit")); _ijlFree = reinterpret_cast<PIJLFREE>(GetProcAddress(LibJpeg, "ijlFree")); _ijlRead = reinterpret_cast<PIJLREAD>(GetProcAddress(LibJpeg, "ijlRead")); _ijlWrite = reinterpret_cast<PIJLWRITE>(GetProcAddress(LibJpeg, "ijlWrite")); } // dsound.dll LibDsound = LoadLibraryA("dsound.dll"); if (LibDsound == nullptr) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10036u); pszMessage = "Cannot load DirectSound dll"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } _DirectSoundCreate = reinterpret_cast<PDIRECTSOUNDCREATE>(GetProcAddress(LibDsound, "DirectSoundCreate")); _DirectSoundEnumerate = reinterpret_cast<PDIRECTSOUNDENUMERATEA>( GetProcAddress(LibDsound, "DirectSoundEnumerateA")); if ((_DirectSoundCreate == nullptr) && (_DirectSoundEnumerate == nullptr)) { pszMessage = "Cannot find DirectSound functions"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } // dinput.dll LibDinput = LoadLibraryA("dinput.dll"); if (LibDinput == nullptr) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10038u); pszMessage = "Cannot load DirectInput dll"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } _DirectInputCreateEx = reinterpret_cast<PDIRECTINPUTCREATEEX>(GetProcAddress(LibDinput, "DirectInputCreateEx")); if (_DirectInputCreateEx == nullptr) { pszMessage = "Cannot find DirectInput functions"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } // imm32.dll LibIME = LoadLibraryA("imm32.dll"); if (LibIME) { _ImmGetContext = reinterpret_cast<PIMMGETCONTEXT>(GetProcAddress(LibIME, "ImmGetContext")); _ImmReleaseContext = reinterpret_cast<PIMMRELEASECONTEXT>(GetProcAddress(LibIME, "ImmReleaseContext")); _ImmAssociateContext = reinterpret_cast<PIMMASSOCIATECONTEXT>(GetProcAddress(LibIME, "ImmAssociateContext")); _ImmGetCompositionString = reinterpret_cast<PIMMGETCOMPOSITIONSTRINGA>( GetProcAddress(LibIME, "ImmGetCompositionStringA")); _ImmGetOpenStatus = reinterpret_cast<PIMMGETOPENSTATUS>(GetProcAddress(LibIME, "ImmGetOpenStatus")); _ImmSetOpenStatus = reinterpret_cast<PIMMSETOPENSTATUS>(GetProcAddress(LibIME, "ImmSetOpenStatus")); _ImmGetConversionStatus = reinterpret_cast<PIMMGETCONVERSIONSTATUS>( GetProcAddress(LibIME, "ImmGetConversionStatus")); _ImmGetCandidateList = reinterpret_cast<PIMMGETCANDIDATELISTA>(GetProcAddress(LibIME, "ImmGetCandidateListA")); _ImmGetVirtualKey = reinterpret_cast<PIMMGETVIRTUALKEY>(GetProcAddress(LibIME, "ImmGetVirtualKey")); _ImmLockIMC = reinterpret_cast<PIMMLOCKIMC>(GetProcAddress(LibIME, "ImmLockIMC")); _ImmUnlockIMC = reinterpret_cast<PIMMUNLOCKIMC>(GetProcAddress(LibIME, "ImmUnlockIMCC")); _ImmLockIMCC = reinterpret_cast<PIMMLOCKIMCC>(GetProcAddress(LibIME, "ImmLockIMCC")); _ImmUnlockIMCC = reinterpret_cast<PIMMUNLOCKIMCC>(GetProcAddress(LibIME, "ImmUnlockIMC")); _ImmGetDefaultIMEWnd = reinterpret_cast<PIMMGETDEFAULTIMEWND>(GetProcAddress(LibIME, "ImmGetDefaultIMEWnd")); _ImmGetIMEFileName = reinterpret_cast<PIMMGETIMEFILENAME>(GetProcAddress(LibIME, "ImmGetIMEFileNameA")); _ImmNotifyIME = reinterpret_cast<PIMMNOTIFYIME>(GetProcAddress(LibIME, "ImmNotifyIME")); _ImmSetConversionStatus = reinterpret_cast<PIMMSETCONVERSIONSTATUS>( GetProcAddress(LibIME, "ImmSetConversionStatus")); _ImmSimulateHotKey = reinterpret_cast<PIMMSIMULATEHOTKEY>(GetProcAddress(LibIME, "ImmSimulateHotKey")); _ImmIsIME = reinterpret_cast<PIMMISIME>(GetProcAddress(LibIME, "ImmIsIME")); } // psapi.dll if (WindowsNT) LibPSAPI = LoadLibraryA("psapi.dll"); else LibPSAPI = nullptr; if (LibPSAPI) { _EmptyWorkingSet = reinterpret_cast<PEMPTYWORKINGSET>(GetProcAddress(LibPSAPI, "EmptyWorkingSet")); _InitializeProcessForWsWatch = reinterpret_cast<PINITIALIZEPROCESSFORWSWATCH>( GetProcAddress(LibPSAPI, "InitializeProcessForWsWatch")); _GetWsChanges = reinterpret_cast<PGETWSCHANGES>(GetProcAddress(LibPSAPI, "GetWsChanges")); _GetMappedFileName = reinterpret_cast<PGETMAPPEDFILENAMEA>(GetProcAddress(LibPSAPI, "GetMappedFileNameA")); } // ws2_32.dll if (Environment.NetworkGame || gEnableGosView) { LibWinSock = LoadLibraryA("ws2_32.dll"); if (LibWinSock == nullptr) LibWinSock = LoadLibraryA("wsock32.dll"); if (LibWinSock) { _accept = reinterpret_cast<PACCEPT>(GetProcAddress(LibWinSock, "accept")); _bind = reinterpret_cast<PBIND>(GetProcAddress(LibWinSock, "bind")); _closesocket = reinterpret_cast<PCLOSESOCKET>(GetProcAddress(LibWinSock, "closesocket")); _gethostbyname = reinterpret_cast<PGETHOSTBYNAME>(GetProcAddress(LibWinSock, "gethostbyname")); _gethostname = reinterpret_cast<PGETHOSTNAME>(GetProcAddress(LibWinSock, "gethostname")); _getservbyname = reinterpret_cast<PGETSERVBYNAME>(GetProcAddress(LibWinSock, "getservbyname")); _htonl = reinterpret_cast<PHTONL>(GetProcAddress(LibWinSock, "htonl")); _htons = reinterpret_cast<PHTONS>(GetProcAddress(LibWinSock, "htons")); _inet_addr = reinterpret_cast<PINET_ADDR>(GetProcAddress(LibWinSock, "inet_addr")); _listen = reinterpret_cast<PLISTEN>(GetProcAddress(LibWinSock, "listen")); _ntohl = reinterpret_cast<PNTOHL>(GetProcAddress(LibWinSock, "ntohl")); _recv = reinterpret_cast<PRECV>(GetProcAddress(LibWinSock, "recv")); _recvfrom = reinterpret_cast<PRECVFROM>(GetProcAddress(LibWinSock, "recvfrom")); _send = reinterpret_cast<PSEND>(GetProcAddress(LibWinSock, "send")); _sendto = reinterpret_cast<PSENDTO>(GetProcAddress(LibWinSock, "sendto")); _socket = reinterpret_cast<PSOCKET>(GetProcAddress(LibWinSock, "socket")); _WSACleanup = reinterpret_cast<PWSACLEANUP>(GetProcAddress(LibWinSock, "WSACleanup")); _WSAGetLastError = reinterpret_cast<PWSAGETLASTERROR>(GetProcAddress(LibWinSock, "WSAGetLastError")); _WSAStartup = reinterpret_cast<PWSASTARTUP>(GetProcAddress(LibWinSock, "WSAStartup")); } } // amstream.dll quartz.dll msadp32.acm LibAmstream = LoadLibraryA("amstream.dll"); LibQuartz = LoadLibraryA("quartz.dll"); LibMSADP32 = LoadLibraryA("msadp32.acm"); if ((LibAmstream == nullptr) || (LibQuartz == nullptr)) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10040u); pszMessage = "DirectX Media not installed"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } if (LibMSADP32 == nullptr) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10042Au); pszMessage = "Microsoft audio compression not installed"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } // NOTE: useless code => meant to be moved up? if (LibAmstream == nullptr) { nBufferSize = strlen("amstream.dll - Version 6.01"); pszMessage = GetDLLInfo("amstream.dll", 0); if (strncmp(pszMessage, "amstream.dll - Version 6.01", nBufferSize) < 0) { // pszMessage = gos_GetResourceString(gLanguageDLL, 10043u); pszMessage = "Please install DirectX Media 6.0 or later"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } } _AMGetErrorText = reinterpret_cast<PAMGETERRORTEXTA>(GetProcAddress(LibQuartz, "AMGetErrorTextA")); if (_AMGetErrorText == nullptr) { pszMessage = "Cannot find DirectShow functions"; MessageBoxA(nullptr, pszMessage, ApplicationName, MB_ICONEXCLAMATION); status = AfterExit; _exit(EXIT_FAILURE); } #if _CONSIDERED_OBSOLETE // Windows 9X vmcpd.vxd VersionInformation.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); GetVersionExA(&VersionInformation); if (WindowsNT == false) { if (HasKatmai) { if (LOWORD(VersionInformation.dwBuildNumber) == 1998) { GetSystemDirectoryA(szDirBuffer, MAX_PATH); strcat(szDirBuffer, "\\vmm32\\vmcpd.vxd"); if (gos_DoesFileExist(szDirBuffer) == false) { strcpy_s(szInstallMessage, _countof(szInstallMessage), "You need to install \"vmcpd.vxd\" This can be found " "in DirectX 7.0 SDK \"DXF\\extras\\win98 piii dbg\" " "folder."); if (OnNetwork == true) strcat_s(szInstallMessage, _countof(szInstallMessage), "\n\n(Microsoft Internal) - This can be found at " "\\\\dxrelease\\release\\dx7\\DXF\\extras\\win98 " "piii dbg"); MessageBoxA(nullptr, szInstallMessage, ApplicationName, MB_ICONEXCLAMATION); } } } } #endif // odbc32.dll LibODBC = LoadLibraryA("odbc32.dll"); if (LibODBC) { _SQLAllocHandle = reinterpret_cast<PSQLALLOCHANDLE>(GetProcAddress(LibODBC, "SQLAllocHandle")); _SQLBindCol = reinterpret_cast<PSQLBINDCOL>(GetProcAddress(LibODBC, "SQLBindCol")); _SQLBindParameter = reinterpret_cast<PSQLBINDPARAMETER>(GetProcAddress(LibODBC, "SQLBindParameter")); _SQLDisconnect = reinterpret_cast<PSQLDISCONNECT>(GetProcAddress(LibODBC, "SQLDisconnect")); _SQLDriverConnect = reinterpret_cast<PSQLDRIVERCONNECT>(GetProcAddress(LibODBC, "SQLDriverConnect")); _SQLExecDirect = reinterpret_cast<PSQLEXECDIRECT>(GetProcAddress(LibODBC, "SQLExecDirect")); _SQLFetch = reinterpret_cast<PSQLFETCH>(GetProcAddress(LibODBC, "SQLFetch")); _SQLFreeHandle = reinterpret_cast<PSQLFREEHANDLE>(GetProcAddress(LibODBC, "SQLFreeHandle")); _SQLFreeStmt = reinterpret_cast<PSQLFREESTMT>(GetProcAddress(LibODBC, "SQLFreeStmt")); _SQLGetDiagField = reinterpret_cast<PSQLGETDIAGFIELD>(GetProcAddress(LibODBC, "SQLGetDiagField")); _SQLGetDiagRec = reinterpret_cast<PSQLGETDIAGREC>(GetProcAddress(LibODBC, "SQLGetDiagRec")); _SQLNumResultCols = reinterpret_cast<PSQLNUMRESULTCOLS>(GetProcAddress(LibODBC, "SQLNumResultCols")); _SQLSetEnvAttr = reinterpret_cast<PSQLSETENVATTR>(GetProcAddress(LibODBC, "SQLSetEnvAttr")); } gos_MathExceptions(true, false); }