For complete code, refer to the CNVWM demo.
LPTSTR OLE2A(LPCOLESTR lpw)
{
static CHAR convert[512];
if(!lpw)
return NULL;
convert[0] = '\0';
WideCharToMultiByte(CP_ACP, 0, lpw, -1, convert, 512, NULL, NULL);
return convert;
}
BOOL IltmmWMProfile_get_Version_Example ( )
{
long count = 0;
long streamCount = 0;
long versionNum = 0;
long lVersion;
char data[10];
IltmmWMProfile *pProfile = NULL;
IltmmWMProfileManager *pProfileManager = NULL;
BSTR bstrString;
int i;
// Create a profile manager
HRESULT hr = CoCreateInstance(&CLSID_ltmmWMProfileManager, NULL, CLSCTX_INPROC_SERVER, &IID_IltmmWMProfileManager, (void**) &pProfileManager);
if(FAILED(hr))
{
return TRUE;
}
// show only system profiles for version ltmmWMT_VER_4_0
IltmmWMProfileManager_get_SystemProfileVersion(pProfileManager, &lVersion);
if(lVersion != ltmmWMT_VER_4_0)
{
IltmmWMProfileManager_Release(pProfileManager);
return TRUE;
}
hr = IltmmWMProfileManager_get_SystemProfileCount(pProfileManager, &count);
if(FAILED(hr))
{
IltmmWMProfileManager_Release(pProfileManager);
return TRUE;
}
for(i = 0; i < count; i++)
{
hr = IltmmWMProfileManager_LoadSystemProfile(pProfileManager, i, &pProfile);
if(FAILED(hr))
{
IltmmWMProfileManager_Release(pProfileManager);
return TRUE;
}
// Display the name
IltmmWMProfile_get_Name(pProfile, &bstrString);
printf ("%s", OLE2A(bstrString));
SysFreeString(bstrString);
// Add the description, version and the stream count
IltmmWMProfile_get_Description(pProfile, &bstrString);
printf ("%s", OLE2A(bstrString));
SysFreeString(bstrString);
IltmmWMProfile_get_Version(pProfile, &versionNum);
switch(versionNum)
{
case ltmmWMT_VER_4_0:
printf ("%s", "ltmmWMT_VER_4_0");
break;
case ltmmWMT_VER_7_0:
printf ("%s", "ltmmWMT_VER_7_0");
break;
case ltmmWMT_VER_8_0:
printf ("%s", "ltmmWMT_VER_8_0");
break;
case ltmmWMT_VER_9_0:
printf ("%s", "ltmmWMT_VER_9_0");
break;
default:
printf ("%s", "UNKNOWN");
break;
};
// Display the number of streams
IltmmWMProfile_get_StreamCount(pProfile, &streamCount);
printf ("%s", ltoa(streamCount, data, 10));
IltmmWMProfile_Release(pProfile);
pProfile = NULL;
}
IltmmWMProfileManager_Release(pProfileManager);
pProfileManager = NULL;
return TRUE;
}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.