Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. RTTI problem

RTTI problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestioncomcareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karismatic
    wrote on last edited by
    #1

    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

    M P 2 Replies Last reply
    0
    • K Karismatic

      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

      M Offline
      M Offline
      Matthew Faithfull
      wrote on last edited by
      #2

      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)

      1 Reply Last reply
      0
      • K Karismatic

        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

        P Offline
        P Offline
        Paresh Chitte
        wrote on last edited by
        #3

        Hi, Have you tried CObject::IsKindOf ? Regards, Paresh.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups