Parcourir la source

restore the calling of LoadCommonFunctions

11 il y a 1 an
Parent
commit
0fbcdf672f

+ 1 - 1
OTSCPP/OTSControl/Bruker/Bruker.API.CommonFunctions.h

@@ -205,7 +205,7 @@ namespace BrukerDll
 	// State constants generated from Bruker.API.*.dll
 	const int32_t STATE_WAS_RUNNING_BEFORE = -201;
 
-	bool LoadCommonFunctions(const wchar_t* LibFile);
+	bool LoadCommonFunctions(const LPCTSTR LibFile);
 
 	// Convert int32_t to String
 	std::string IntToString(int32_t number);

+ 1 - 1
OTSCPP/OTSControl/Bruker/Bruker.API.Esprit.cpp

@@ -204,7 +204,7 @@ namespace BrukerDll
 	   const wchar_t* csAPILibFile = L"Bruker.API.Esprit.DLL";
 	#endif
 
-	   //LoadCommonFunctions(csAPILibFile);
+	   LoadCommonFunctions(csAPILibFile);
 		hEspritDllBaseAddress = LoadLibrary(csAPILibFile);
 		if (!hEspritDllBaseAddress)
 		{ 

+ 2 - 1
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -1360,7 +1360,8 @@ namespace OTSController {
 		long nBufferSize = (long)BRUKER_PARAM::BUF_LENGTH;
 		m_psServerName.reset(new char[(int)BRUKER_PARAM::BUF_LENGTH]);
 		memset(m_psServerName.get(), 0, nBufferSize);
-		if (BrukerDll::QueryServers(m_psServerName.get(), nBufferSize) != 0)
+		int ret = BrukerDll::QueryServers(m_psServerName.get(), nBufferSize);
+		if ( ret!= 0)
 		{
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::QueryServers: failed to call QueryServers method."));
 			return FALSE;