本文整理汇总了C++中CAtlString::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ CAtlString::GetString方法的具体用法?C++ CAtlString::GetString怎么用?C++ CAtlString::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAtlString
的用法示例。
在下文中一共展示了CAtlString::GetString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rho_sysimpl_get_property
int rho_sysimpl_get_property(char* szPropName, VALUE* resValue)
{
if (strcasecmp("webview_framework",szPropName) == 0)
{
#ifdef RHODES_EMULATOR
*resValue = rho_ruby_create_string("WEBKIT/" QTWEBKIT_VERSION_STR);
#elif defined(APP_BUILD_CAPABILITY_WEBKIT_BROWSER)
*resValue = rho_ruby_create_string("WEBKIT");
#else
rho::String msieVer = "IE";
get_msie_version(msieVer);
*resValue = rho_ruby_create_string(msieVer.c_str());
#endif
return 1;
}
#ifdef RHODES_EMULATOR
if (strcasecmp("main_window_closed",szPropName) == 0)
{*resValue = rho_ruby_create_boolean(CMainWindow::mainWindowClosed); return 1;}
#endif
if (strcasecmp("has_camera",szPropName) == 0)
{*resValue = rho_ruby_create_boolean(has_camera()); return 1;}
if (strcasecmp("phone_number",szPropName) == 0)
{*resValue = phone_number();return 1;}
if (strcasecmp("ppi_x",szPropName) == 0)
{*resValue = rho_ruby_create_double(get_screen_ppi_x()); return 1;}
if (strcasecmp("ppi_y",szPropName) == 0)
{*resValue = rho_ruby_create_double(get_screen_ppi_y()); return 1; }
if (strcasecmp("locale",szPropName) == 0)
{*resValue = rho_sys_get_locale(); return 1;}
if (strcasecmp("country",szPropName) == 0)
{
wchar_t szCountry[20];
int nRes = GetLocaleInfo(LOCALE_USER_DEFAULT,LOCALE_SISO3166CTRYNAME , szCountry, sizeof(szCountry)/sizeof(szCountry[0]));
szCountry[2] = 0;
*resValue = rho_ruby_create_string(convertToStringA(szCountry).c_str());
return 1;
}
if (strcasecmp("device_name",szPropName) == 0)
{
#ifdef OS_WINDOWS
*resValue = rho_ruby_create_string("Win32");
return 1;
#else
HKEY hKey;
int nRes = 0;
if (RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("Ident"),
0, KEY_READ, &hKey ) != ERROR_SUCCESS)
return nRes;
DWORD dwType = REG_SZ;
DWORD dwDataSize = 0;
if ( RegQueryValueEx( hKey, _T("name"), 0, &dwType, (PBYTE)NULL, &dwDataSize ) == ERROR_SUCCESS)
{
CAtlString deviceName;
RegQueryValueEx( hKey, _T("name"), 0, &dwType,
(PBYTE)deviceName.GetBuffer((dwDataSize/sizeof(TCHAR) + sizeof(TCHAR))), &dwDataSize );
deviceName.ReleaseBuffer();
*resValue = rho_ruby_create_string( convertToStringA(deviceName.GetString()).c_str() );
nRes = 1;
}
RegCloseKey(hKey);
return nRes;
#endif
}
if (strcasecmp("os_version",szPropName) == 0)
{
OSVERSIONINFO osv;
osv.dwOSVersionInfoSize = sizeof(osv);
if (!GetVersionEx(&osv))
return 0;
char buf[50];
buf[sizeof(buf) - 1] = '\0';
snprintf(buf, sizeof(buf) - 1, "%u.%u.%u", (unsigned)osv.dwMajorVersion,
(unsigned)osv.dwMinorVersion, (unsigned)osv.dwBuildNumber);
*resValue = rho_ruby_create_string(&buf[0]);
return 1;
}
if (strcasecmp("is_emulator",szPropName) == 0)
{
bool bEmulator = false;
#ifdef OS_WINDOWS
bEmulator = true;
#else
#endif
*resValue = rho_ruby_create_boolean(bEmulator?1:0);
//.........这里部分代码省略.........