ActiveX control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sunny

    #1

    ActiveX control

    Hi all,
    My dev platform: VS .net 2003, win2000pro, office 2000, MOD 2000, C#.

    Bellow you may read my posting in other group. According that issue, I have
    dig around and I'm wondering ...

    My code for creating the ActiveX control in C# is:
    [GuidAttribute(" 0E887A3F-D8BA-4d0e-8781-EBFAE5820844"),
    ProgId("MyApp.O ptions")]
    [ClassInterface( ClassInterfaceT ype.AutoDual)]
    public class IceOptions : System.Windows. Forms.UserContr ol,
    Outlook.Propert yPage
    ......

    So, it is exposed to COM interop, and outlook succeeds to initialize and
    display it. The problem is that I can not reach the calling container and
    its methods/properties.
    If I stop the execution somewhere in my control, I can seen in debugger
    that under this. there are some AcitveX related properties for my class
    (like - ActiveXInstance {System.Windows .Forms.Control. ActiveXImpl}
    System.Windows. Forms.Control.A ctiveXImpl
    ).
    How can I reach these properties in my code??? If I try:
    mySite = (Outlook.Proper tyPageSite)this .ActiveXInstanc e.clientSite is says:
    'System.Windows .Forms.Control. ActiveXInstance ' is inaccessible due to its
    protection level

    Is there a workaround?

    Thanks for reading this :)
    Sunny

    P.S. Here is the main problem:


    I'm trying to add custom property/option tab in Outlook 2000 Options. So far
    I succeeded to create the control which implements Outlook.Propert yPage
    interface. It displays OK, but I could not reference the parent
    PropertyPageSit e property to invoke OnStatusChange( ) method, so I can not
    use Apply and OK buttons to apply changes.

    I have read some articles in that direction, but all of them are not real
    solution, and they are more than year old, so I'm wondering if so far
    someone have succeeded in this approach?

    Any suggestion/solution will be highly appreciated.

    Thanks
    Sunny


  • D.J. Heap

    #2
    Re: ActiveX control

    Stephane Rodriguez wrote:[color=blue]
    > The only unmanaged ActiveX host supporting .NET controls is Internet
    > Explorer.
    > http://support.microsoft.com/default...b;EN-US;311334
    >[/color]

    That is not quite true as of v1.1 (the article is specific to 1.0) --
    MFC7.1 is a supported unmanaged host, but it has zero IDE support and
    there are a couple of tabbing buglets, and you have to do some work
    yourself to hook things up. There's an article on MSDN by Chris Sells
    for getting started with it (watch for url wrapping):

    http://msdn.microsoft.com/msdnmag/is...s/default.aspx

    in the Managed Controls in Unmanaged Hosts section.

    DJ

    Comment

    • Stephane Rodriguez

      #3
      Re: ActiveX control



      I have found an undocumented way to achieve what you are looking for.



      Good luck!








      "Sunny" <sunnyask@icebe rgwireless.com> wrote in message
      news:OsaCaM5WDH A.388@TK2MSFTNG P10.phx.gbl...[color=blue]
      > Hi all,
      > My dev platform: VS .net 2003, win2000pro, office 2000, MOD 2000, C#.
      >
      > Bellow you may read my posting in other group. According that issue, I[/color]
      have[color=blue]
      > dig around and I'm wondering ...
      >
      > My code for creating the ActiveX control in C# is:
      > [GuidAttribute(" 0E887A3F-D8BA-4d0e-8781-EBFAE5820844"),
      > ProgId("MyApp.O ptions")]
      > [ClassInterface( ClassInterfaceT ype.AutoDual)]
      > public class IceOptions : System.Windows. Forms.UserContr ol,
      > Outlook.Propert yPage
      > .....
      >
      > So, it is exposed to COM interop, and outlook succeeds to initialize and
      > display it. The problem is that I can not reach the calling container and
      > its methods/properties.
      > If I stop the execution somewhere in my control, I can seen in debugger
      > that under this. there are some AcitveX related properties for my class
      > (like - ActiveXInstance {System.Windows .Forms.Control. ActiveXImpl}
      > System.Windows. Forms.Control.A ctiveXImpl
      > ).
      > How can I reach these properties in my code??? If I try:
      > mySite = (Outlook.Proper tyPageSite)this .ActiveXInstanc e.clientSite is[/color]
      says:[color=blue]
      > 'System.Windows .Forms.Control. ActiveXInstance ' is inaccessible due to its
      > protection level
      >
      > Is there a workaround?
      >
      > Thanks for reading this :)
      > Sunny
      >
      > P.S. Here is the main problem:
      >
      >
      > I'm trying to add custom property/option tab in Outlook 2000 Options. So[/color]
      far[color=blue]
      > I succeeded to create the control which implements Outlook.Propert yPage
      > interface. It displays OK, but I could not reference the parent
      > PropertyPageSit e property to invoke OnStatusChange( ) method, so I can not
      > use Apply and OK buttons to apply changes.
      >
      > I have read some articles in that direction, but all of them are not real
      > solution, and they are more than year old, so I'm wondering if so far
      > someone have succeeded in this approach?
      >
      > Any suggestion/solution will be highly appreciated.
      >
      > Thanks
      > Sunny
      >
      >[/color]


      Comment

      Working...