Beispiel #1
0
	//-----------------------------------------------------------------------
	std::string Plugin::getLastPluginError()
	{
#if NR_PLATFORM == NR_PLATFORM_WIN32
		LPVOID lpMsgBuf; 
		FormatMessage( 
			FORMAT_MESSAGE_ALLOCATE_BUFFER | 
			FORMAT_MESSAGE_FROM_SYSTEM | 
			FORMAT_MESSAGE_IGNORE_INSERTS, 
			NULL, 
			GetLastError(), 
			MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
			(LPTSTR) &lpMsgBuf, 
			0, 
			NULL 
			); 
		std::string ret = (char*)lpMsgBuf;
		
		// Free the buffer.
		LocalFree( lpMsgBuf );
		return ret;
#elif NR_PLATFORM == NR_PLATFORM_LINUX
		return std::string(dlerror());
#elif NR_PLATFORM == NR_PLATFORM_APPLE
		return std::string(mac_errorBundle());
#else
		return std::string("");
#endif
	}
Beispiel #2
0
//-----------------------------------------------------------------------
std::string DynLib::dynlibError( void ) 
{
#if defined PLATFORM_WIN
	LPVOID lpMsgBuf; 
	FormatMessage( 
		FORMAT_MESSAGE_ALLOCATE_BUFFER | 
		FORMAT_MESSAGE_FROM_SYSTEM | 
		FORMAT_MESSAGE_IGNORE_INSERTS, 
		NULL, 
		GetLastError(), 
		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), 
		(LPTSTR) &lpMsgBuf, 
		0, 
		NULL 
		); 
	std::string ret = (char*)lpMsgBuf;
	// Free the buffer.
	LocalFree( lpMsgBuf );
	return ret;
#elif defined PLATFORM_LINUX
	return std::string(dlerror());
#elif  defined PLATFORM_MAC
	return std::string(mac_errorBundle());
#else
	return "";
#endif
}