CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2005
    Location
    Pune (India)
    Posts
    644

    Thumbs up How to add ActiveX control at runtime

    Hi
    I want to build a program which can add any registered activeX control in the client area at runtime and use its functionality. Is there any way to do this .

    Thanks in Advance
    Anant

  2. #2
    Join Date
    Mar 2005
    Location
    Romania,Cluj-Napoca
    Posts
    1,073

    Re: How to add ActiveX control at runtime

    If you are using mfc you create the generated mfc application when you finished the wizard you then you select click on the projects menu ->add to project then-> select control and components.

  3. #3
    Join Date
    Feb 2005
    Location
    Pune (India)
    Posts
    644

    Thumbs up Re: How to add ActiveX control at runtime

    Hi g_gili
    My problem is to add the activex at runtime where i will know only the class id of activex control, There is one dialog box in my application which shows all registered controls , now When user will select particular activex from list it should be added in to client area i.e creation of object as well as calling the functions on the control.
    I am expecting the same mechanism which is used by visual studio itself when we insert the component.
    Is it possible to create the object using class ID and name of class ( "String" )

    Thanks in Advance
    Anant

  4. #4
    Join Date
    Apr 2005
    Posts
    247

    Arrow Re: How to add ActiveX control at runtime

    Hi Anant,
    Cool question Indeed. Good that you brought this back. Unfortunately I am very poor (must say close to 0) in COM. So COM guru Siddhartha would you please answer to this question.

    Regards,
    Ashwin

  5. #5
    Join Date
    Feb 2004
    Posts
    6

    Talking Re: How to add ActiveX control at runtime

    I have an idea for solving this problem.
    Maybe you should handle all the ActiveX you have first. Such as derive a new class for each ActiceX object, and use DECLARE_DYNCREAT and IMPLEMENT_DYNCREAT macros to make your new classes have the ability to be created at runtime.

    Basicly, if you want to creat an object at runtime, you MUST have an CLASS MAP first. And when the application get an class name at runtime, it can find the rigth element from the CLASS MAP.

    You can reference the CRuntimeClass in MFC.

    Wish this would be helpful!

  6. #6
    Join Date
    Feb 2005
    Location
    Pune (India)
    Posts
    644

    Thumbs up Re: How to add ActiveX control at runtime

    Hi JonyPoet
    Firstly Thanks for quick attention , I can't find the source code. Please send me that source code if uoy can.

    Thanks
    Anant

  7. #7
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: How to add ActiveX control at runtime

    Quote Originally Posted by anantwakode
    Hi JonyPoet
    Firstly Thanks for quick attention , I can't find the source code. Please send me that source code if uoy can.

    Thanks
    Anant
    I have compressed it, but in the smallest form its more then 100k so I put it into parts. put part1 and Part 2 into the same directory. then it should compile and work. Tell me when you have it, by private message because its useless space on the server and I'll delete when u have it

    Jonny Poet

    Files deleted
    Last edited by JonnyPoet; May 23rd, 2005 at 12:55 PM.
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  8. #8

    Re: How to add ActiveX control at runtime

    Hi,
    If you want to create a visio 2003 like application that contain the activex control with editing and moving,I think a good way is to use DrawCli application,or other third party MFC Kit,such as XD++ MFC Library with http://www.********.net

    Jack

  9. #9
    Join Date
    Mar 2005
    Location
    Vienna, Austria
    Posts
    4,538

    Re: How to add ActiveX control at runtime

    Additional note: The files I pointed him too was tstcon32.exe which is contained totally within sourcecode in VS.net 2003 !
    Jonny Poet

    To be Alive is depending on the willingsness to help others and also to permit others to help you. So lets be alive. !
    Using Code Tags makes the difference: Code is easier to read, so its easier to help. Do it like this: [CODE] Put Your Code here [/code]
    If anyone felt he has got help, show it in rating the post.
    Also dont forget to set a post which is fully answered to 'resolved'. For more details look to FAQ's about Forum Usage. BTW I'm using Framework 3.5 and you ?
    My latest articles :
    Creating a Dockable Panel-Controlmanager Using C#, Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

  10. #10
    Join Date
    Apr 1999
    Posts
    3,585

    Re: How to add ActiveX control at runtime

    Take a look at CWnd::CreateControl(). I think that's what you want.
    Gort...Klaatu, Barada Nikto!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured