ActiveX control

S

Sunny

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.Options")]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class IceOptions : System.Windows.Forms.UserControl,
Outlook.PropertyPage
......

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.ActiveXImpl
).
How can I reach these properties in my code??? If I try:
mySite = (Outlook.PropertyPageSite)this.ActiveXInstance.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.PropertyPage
interface. It displays OK, but I could not reference the parent
PropertyPageSite 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

D.J. Heap

Stephane said:
The only unmanaged ActiveX host supporting .NET controls is Internet
Explorer.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;311334

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/issues/03/03/windowsforms/default.aspx

in the Managed Controls in Unmanaged Hosts section.

DJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top