>Used your code to detect DCOM. Got error message "variable not found HKEY_LOCAL_MACHINE". TIA
You're missing the #DEFINEs from REGISTRY.H; don't forget the #INCLUDE which is absolutely necessary. HKEY_LOCAL_MACHINE should be defined as:
#DEFINE HKEY_LOCAL_MACHINE -2147483646 && BITSET(0,31)+2