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#
  4. ActiveX and c#

ActiveX and c#

Scheduled Pinned Locked Moved C#
questioncsharphtmlcomdocker
4 Posts 2 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.
  • O Offline
    O Offline
    ORi x
    wrote on last edited by
    #1

    Hi ! I'd like to know how can I pass parameters to an ActiveX in a c# windows application. As far as I know, the ActiveX control implements IPersistPropertyBag so that the container in html can pass the params through the Tag PARAM in the HTML tag OBJECT. However, I don't know how to do it within a c# application. Please, somebody could help me ??? thx in advance,

    S 1 Reply Last reply
    0
    • O ORi x

      Hi ! I'd like to know how can I pass parameters to an ActiveX in a c# windows application. As far as I know, the ActiveX control implements IPersistPropertyBag so that the container in html can pass the params through the Tag PARAM in the HTML tag OBJECT. However, I don't know how to do it within a c# application. Please, somebody could help me ??? thx in advance,

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      Derive AxHost, you've got the following protected load methods :

      DepersistControl();
      DepersistFromIPropertyBag(IPropertyBag propBag);
      DepersistFromIStorage(IStorage storage);
      DepersistFromIStream(IStream istream);
      DepersistFromIStreamInit(IStream istream);


      MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.

      O 1 Reply Last reply
      0
      • S Stephane Rodriguez

        Derive AxHost, you've got the following protected load methods :

        DepersistControl();
        DepersistFromIPropertyBag(IPropertyBag propBag);
        DepersistFromIStorage(IStorage storage);
        DepersistFromIStream(IStream istream);
        DepersistFromIStreamInit(IStream istream);


        MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.

        O Offline
        O Offline
        ORi x
        wrote on last edited by
        #3

        Sorry but I'm quite new in c# and I don't know exactly what u mean, could u please explain it? When I add my Ax control "myCtrl" in the aplication, I think Aximp.exe creates AxmyCtrl which is the wrapper for my control and is dervied from AxHost. However, if I derive this class, I can't find the protected methods u talked about. I've looked in the help for the members of AxHost and I don't find those protected methods. Could u tell me more exactly what should I do? thx for everything, ORi.

        S 1 Reply Last reply
        0
        • O ORi x

          Sorry but I'm quite new in c# and I don't know exactly what u mean, could u please explain it? When I add my Ax control "myCtrl" in the aplication, I think Aximp.exe creates AxmyCtrl which is the wrapper for my control and is dervied from AxHost. However, if I derive this class, I can't find the protected methods u talked about. I've looked in the help for the members of AxHost and I don't find those protected methods. Could u tell me more exactly what should I do? thx for everything, ORi.

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          Using an ActiveX with .NET is achieved with one of these : - you simply want to drag&drop the component onto a form. So yes, you import it from the Toolbox Window, and when you drop it, the .NET environment creates two wrapper assemblies (one for the ActiveX layer, one for the underlying COM layer). That's perfect as long as you just need to call methods, properties, and stuff. I would think that, once activated in a form, the ActiveX would by itself (I mean with no additional code) selfs depersists, hence load the previous state, but eh... who knows... - the other solution is to bypass the wrapper assemblies, and derive the System.Windows.Forms.AxHost class. Once derived, you just need to implement a few methods to get this class actually attached to the underlying ActiveX. For more info on it, just googlesearch with "AxHost" : you'll find code. What I said in an earlier post is, once the class is derived, you may call one of the listed methods in the constructor (or any adequate place) to load the previous state.


          MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.

          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