本文整理汇总了C++中JString::t_str方法的典型用法代码示例。如果您正苦于以下问题:C++ JString::t_str方法的具体用法?C++ JString::t_str怎么用?C++ JString::t_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JString
的用法示例。
在下文中一共展示了JString::t_str方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MatroskaShellExt_SetRegistryValueStr
void MatroskaShellExt_SetRegistryValueStr(TCHAR *value_key, JString the_value)
{
TCHAR *reg_key = _T("SOFTWARE\\MatroskaProp\\");
HKEY key_handle = NULL;
DWORD lpType = NULL;
DWORD state = 0;
SECURITY_ATTRIBUTES sa = {sizeof(sa), 0,1};
RegCreateKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, _T(""), 0, KEY_WRITE, &sa, &key_handle, &state);
DWORD size = (the_value.length()+1)*sizeof(TCHAR);
RegSetValueEx(key_handle, value_key, 0, REG_SZ, (CONST BYTE*)the_value.t_str(), size);
//char *err_key = new char[1024];
//FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, temp, 0, err_key, 1024, NULL);
RegCloseKey(key_handle);
};
示例2: MediaPropProc_SimpleTag
BOOL CALLBACK MediaPropProc_SimpleTag(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) {
#if 0
//TRACE("Simple Tag Tab Msg: %X wParam: %i lParam: %i \n", uMsg, wParam, lParam);
CRASH_PROTECT_START;
//Get the dialog data
MatroskaPages *pageData = (MatroskaPages *)GetWindowLong(hwndDlg, DWL_USER);
switch(uMsg) {
case WM_INITDIALOG:
{
INITCOMMONCONTROLSEX common;
common.dwICC = ICC_DATE_CLASSES;
common.dwSize = sizeof(common);
InitCommonControlsEx(&common);
SendDlgItemMessage(hwndDlg, IDC_SPIN_TAG_RATING, UDM_SETRANGE, 0, (LPARAM)MAKELONG((short)10, (short)-10));
//Store the MatroskaPages struct in the DWL_USER
SetWindowLong(hwndDlg, DWL_USER, (LONG)lParam);
pageData = (MatroskaPages *)lParam;
#ifdef MATROSKA_PROP
MoreData *pm;
// When the shell creates a dialog box for a property sheet page,
// it passes the pointer to the PROPSHEETPAGE data structure as
// lParam. The dialog procedures of extensions typically store it
// in the DWL_USER of the dialog box window.
SetWindowLong(hwndDlg, DWL_USER, lParam);
pm = (MoreData *)lParam;
pageData = pm->pObjPageData;
pageData->AddRef();
//Store the Matroska Infomation dialog handle
pageData->g_hSimpleTagDialog = hwndDlg;
//Store the MatroskaPages struct in the DWL_USER
SetWindowLong(hwndDlg, DWL_USER, (LONG)pageData);
ODS("Displaying Tag Tab");
if ((pageData->parser == NULL) || !pageData->parser->found_tags)
{
delete pageData->parser;
pageData->parser = new MatroskaInfoParser(pm->pObjPageData->szFile);
pageData->parser->m_parseSeekHead = true;
pageData->parser->m_parseAttachments = true;
pageData->parser->m_parseTags = true;
ParseFileMT(pageData, hwndDlg);
//pageData->parser->ParseFile();
}
DisplaySimpleTagTrackList(pageData->g_hSimpleTagDialog, pageData->parser);
// Update the tabs
if (pageData->g_hInfoDialog != NULL)
DisplayMainTrackList(pageData->g_hInfoDialog, pageData->parser);
if (pageData->g_hAttachmentDialog != NULL)
DisplayAttachmentList(pageData->g_hAttachmentDialog, pageData->parser);
if (pageData->g_hTagDialog != NULL)
DisplayTagEntryList(pageData->g_hTagDialog, pageData->parser);
#endif
return TRUE;
break;
}
case WM_DESTROY:
{
#ifdef MATROSKA_PROP
pageData->Release();
#endif // MATROSKA_PROP
break;
}
case WM_COMMAND:
{
switch (LOWORD(wParam)) { /* Find which control the message applies to */
case IDC_COMBO_TAG_SIMPLE_TRACKS:
{
switch (HIWORD(wParam))
{
case CBN_SELCHANGE:
{
HWND hwndTrackCombo;
int nItem = 0;
MatroskaTrackInfo *selected_track = NULL;
hwndTrackCombo = GetDlgItem(hwndDlg, IDC_COMBO_TAG_SIMPLE_TRACKS);
nItem = SendMessage(hwndTrackCombo, CB_GETCURSEL, 0, 0);
selected_track = reinterpret_cast<MatroskaTrackInfo *>(SendMessage(hwndTrackCombo, CB_GETITEMDATA, (nItem), 0));
if ((selected_track != NULL) && (nItem != -1))
{
JString tagString;
tagString.clear();
//Fill out the Track Info fields
tagString = JString(_W("Track UID")) + JString::Format(L": %u", selected_track->GetTrackUID());
SetDlgItemText(hwndDlg, IDC_STATIC_TRACK_UID, tagString.t_str());
tagString = pageData->parser->GetTagAlbum(selected_track->GetTagInfo());
SetDlgItemText(hwndDlg, IDC_EDIT_TAG_ALBUM, tagString.t_str());
tagString = pageData->parser->GetTagArtist(selected_track->GetTagInfo());
SetDlgItemText(hwndDlg, IDC_EDIT_TAG_ARTIST, tagString.t_str());
tagString = JString::Format("%f", pageData->parser->GetTagBPM(selected_track->GetTagInfo()));
SetDlgItemText(hwndDlg, IDC_EDIT_TAG_BPM, tagString.t_str());
//.........这里部分代码省略.........