本文整理汇总了C++中CModelTexture2DResource::setPath方法的典型用法代码示例。如果您正苦于以下问题:C++ CModelTexture2DResource::setPath方法的具体用法?C++ CModelTexture2DResource::setPath怎么用?C++ CModelTexture2DResource::setPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModelTexture2DResource
的用法示例。
在下文中一共展示了CModelTexture2DResource::setPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CNMRException
LIB3MFMETHODIMP CCOMModelTexture2D::SetAttachment(_In_ ILib3MFModelAttachment * pTextureAttachment)
{
try {
if (pTextureAttachment == nullptr)
throw CNMRException(NMR_ERROR_INVALIDPOINTER);
CModelTexture2DResource * pTextureResource = getTexture2D();
__NMRASSERT(pTextureResource);
// check relationship type
std::string sRelationshipType;
ULONG cbNeededChars;
pTextureAttachment->GetRelationshipTypeUTF8(nullptr, 0, &cbNeededChars);
sRelationshipType.resize(cbNeededChars);
pTextureAttachment->GetRelationshipTypeUTF8(&(sRelationshipType[0]), cbNeededChars + 1, &cbNeededChars);
if (!(sRelationshipType == PACKAGE_TEXTURE_RELATIONSHIP_TYPE))
throw CNMRException(NMR_ERROR_INVALIDRELATIONSHIPTYPEFORTEXTURE);
std::string sPath;
pTextureAttachment->GetPathUTF8(nullptr, 0, &cbNeededChars);
sPath.resize(cbNeededChars);
pTextureAttachment->GetPathUTF8(&(sPath[0]), cbNeededChars+1, &cbNeededChars);
pTextureResource->setPath(sPath);
return handleSuccess();
}
catch (CNMRException & Exception) {
return handleNMRException(&Exception);
}
catch (...) {
return handleGenericException();
}
}
示例2: CNMRException
LIB3MFMETHODIMP CCOMModelTexture2D::SetPath (_In_z_ LPCWSTR pwszPath)
{
try {
if (pwszPath == nullptr)
throw CNMRException(NMR_ERROR_INVALIDPOINTER);
CModelTexture2DResource * pTextureResource = getTexture2D();
__NMRASSERT(pTextureResource);
std::wstring sPath(pwszPath);
pTextureResource->setPath(sPath);
return handleSuccess();
}
catch (CNMRException & Exception) {
return handleNMRException(&Exception);
}
catch (...) {
return handleGenericException();
}
}