RTTI problem
-
Hi experts, I have an activex control that is placed on a dialog. At runtime I have the nIDs of all the controls so, by using function GetDlgItem I am able to get the pointer to that activex control as CWnd*. So, My question is how can I get that activex class name or how can i identify whether the pointer is of activex class or not. I have already used typeid, CRuntimeClass, and dynamic_cast but unable to get the required result. Please help me in resolving it.
Regards, Pankaj Sachdeva There is no future lies in any job but future lies in the person who holds the job
-
Hi experts, I have an activex control that is placed on a dialog. At runtime I have the nIDs of all the controls so, by using function GetDlgItem I am able to get the pointer to that activex control as CWnd*. So, My question is how can I get that activex class name or how can i identify whether the pointer is of activex class or not. I have already used typeid, CRuntimeClass, and dynamic_cast but unable to get the required result. Please help me in resolving it.
Regards, Pankaj Sachdeva There is no future lies in any job but future lies in the person who holds the job
I can't see why GetRuntimeClass wouldn't work for ordinary controls and dynamic_cast to IUnknown wouldn't work for Ax Controls. Just be prepared to handle the exceptions when you try the wrong one. I have no idea why you'd want to do this anyway, don't you know which controls are ActiveX control already, having put them on the dialog :confused:
"The secret of happiness is freedom, and the secret of freedom, courage." Thucydides (B.C. 460-400)
-
Hi experts, I have an activex control that is placed on a dialog. At runtime I have the nIDs of all the controls so, by using function GetDlgItem I am able to get the pointer to that activex control as CWnd*. So, My question is how can I get that activex class name or how can i identify whether the pointer is of activex class or not. I have already used typeid, CRuntimeClass, and dynamic_cast but unable to get the required result. Please help me in resolving it.
Regards, Pankaj Sachdeva There is no future lies in any job but future lies in the person who holds the job
Hi, Have you tried
CObject::IsKindOf
? Regards, Paresh.