本文整理汇总了C++中Animatable::GetAppDataChunk方法的典型用法代码示例。如果您正苦于以下问题:C++ Animatable::GetAppDataChunk方法的具体用法?C++ Animatable::GetAppDataChunk怎么用?C++ Animatable::GetAppDataChunk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animatable
的用法示例。
在下文中一共展示了Animatable::GetAppDataChunk方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAppData
void AppDataTest::GetAppData()
{
Animatable *anim = PickAnim();
if (!anim) return;
// XRef stuff 020416 --prs.
if (s_through_xref) {
RefTargetHandle rth = (RefTargetHandle)anim;
IXRefItem* xi = NULL;
while (rth != NULL && (xi = IXRefItem::GetInterface(*rth)) != NULL)
rth = xi->GetSrcItem();
if (rth != NULL)
anim = rth;
}
// Grab the app data chunk from the anim
AppDataChunk *ad =
anim->GetAppDataChunk(
APPDATA_TEST_CLASS_ID,
UTILITY_CLASS_ID,
spin->GetIVal());
if (ad && ad->data) {
// Fill the edit field with the text.
TSTR data;
const char* raw_string = (const char*)ad->data;
if (strncmp(raw_string, "\xef\xbb\xbf", 3) == 0)
data = TSTR::FromUTF8(raw_string+3);
else
{
DbgAssert(!_T("Should always convert appdata in UpdateAppDataLoadProc"));
Interface14 *iface = GetCOREInterface14();
LANGID langID = iface->LanguageToUseForFileIO();
UINT codePage = iface->CodePageForLanguage(langID);
data = TSTR::FromCP(codePage, raw_string);
}
SetDlgItemText(hPanel,IDC_APPDATA_EDIT,data.data());
} else {
// Not found!
MessageBox(hPanel,_T("No app data found"),_T("App Data Tester"),MB_OK);
}
}