Hi Bernd,
For my custom objects, I always use the "axdbXXenu.tlb" file and I provide the property names in the CMyObject::GetDisplayName() method.
For example, with an AcDbPolyline derived object :
STDMETHODIMP
CMyObject::GetDisplayName(
/* [in ] */ DISPID dispID,
/* [out] */ BSTR* propName)
{
BSTR result = NULL;
switch (dispID) {
case -23: return E_NOTIMPL;
case DISPID_MY_DISPID: result = ::SysAllocString(L"Dummy" ); break;
case 1025: result = ::SysAllocString(L"My custom object" ); break;
case 1302: result = ::SysAllocString(L"Couleur" ); break;
case 1281: result = ::SysAllocString(L"Calque" ); break;
case 1282: result = ::SysAllocString(L"Type de ligne" ); break;
case 1283: result = ::SysAllocString(L"Echelle du type de ligne" ); break;
case 1299: result = ::SysAllocString(L"Style de tracé" ); break;
case 1300: result = ::SysAllocString(L"Épaisseur de ligne" ); break;
case 1301: result = ::SysAllocString(L"Hyperlien" ); break;
case 1399: result = ::SysAllocString(L"Matériau" ); break;
#if (ACAD_MAX_VERSION >= 1900)
case 1401: result = ::SysAllocString(L"Transparence" ); break;
#endif
case 3: result = ::SysAllocString(L"Hauteur" ); break;
case 1: result = ::SysAllocString(L"Sommet" ); break;
case 10: result = ::SysAllocString(L"Largeur globale" ); break;
case 12: result = ::SysAllocString(L"Élévation" ); break;
case 13: result = ::SysAllocString(L"Aire" ); break;
case 17: result = ::SysAllocString(L"Longueur (génératrice)" ); break;
case 15: result = ::SysAllocString(L"Fermée" ); break;
case 16: result = ::SysAllocString(L"Génération du type de ligne"); break;
default:
{
#ifdef _DEBUG
wchar_t str1[] = L"dispID = %d (0x%08lx) => <%s>";
wchar_t str2[] = L"???";
wchar_t str3[256];
if (*propName != NULL) {
swprintf(str3, str1, dispID, dispID, propName);
} else {
swprintf(str3, str1, dispID, dispID, str2 );
}
::MessageBoxW(NULL, str3, L"CMyObject::GetDisplayName", MB_OK);
result = ::SysAllocString(str3);
#else // !_DEBUG
return E_NOTIMPL;
#endif // !_DEBUG
}
}
if (*propName != NULL)
::SysFreeString(*propName);
*propName = result;
return S_OK;
}The default case is used to get the untranslated property IDs.
Cheers,
Thierry
PS: Sorry if it's in French 🙂