Exposing the .NET UserControl class as an ActiveX
control is possible, but is totally unsupported and
unsanctioned by Microsoft (e.g., you're on your own).
The attached VS.NET 2002 C# project contains a control
that can be hosted by the Dockable Container (on 2004
only). This is a standard UserControl that is exposed
as an ActiveX control.
There are several issues that you need to know,
regarding building and deploying:
1. You must sign the assembly housing the control with
a strong name/key pair, and you must install it into the
global assembly cache (when you deploy).
2. You must set the project property 'Register for COM
interop' to true. If you deploy without an installer,
you must register the assembly using regasm.exe with the
/tlb option. You will see lots of warnings if you do,
regarding CLR types that are not visible to COM, but
but don't worry about them (as long as the container
is not calling methods/properties that refer to those
types, which AcCont doesn't, you should have no problem).
3. All refrerenced assemblies must also be signed with a
strong name/key pair (if you reference interop.AutoCAD
then you'll need to add a key file to the project that
is used to sign referenced interop assemblies, see MSDN
article 313666 for more info).
The major problem with the Dockable container and .NET,
is that everyone that distributes a project like the
one attached, will have to include a strong named RCW
assembly for AcCont16, but since it must be installed
in the global assembly cache, others will also have to
so this, since each sinced assembly is considered to
be different (from a type compatiblity standpoint).
The only solution to that is to have Jorge publish and
distribute Primary COM Interop Assembly for AcCont that
can be installed only if it is not already there.
You might also note that this same problem applies to
AutoCAD's RCW, which is a PIA in 2005, but I do not
believe that's the case in 2004, so everyone that tries
to distribute a signed interop RCW assembly for AutoCAD
will end up stepping on each other.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005
http://www.acadxtabs.com
AcadX for AutoCAD 2004 Beta 1
http://mysite.verizon.net/~vze2vjds/acadx/AcadX16.zip
"PrentaT" wrote in message
news:19603119.1079447695702.JavaMail.jive@jiveforum1.autodesk.com...
> >I have yet to actually do it myself, but I don't see
> >why you can't. Just look at the vb sample that
> > came with the dockable container and adapt it.
> > You can also look at this thread from the ng for
> > info on connecting to it:
>
> Thanks.
>
> The VB sample doesn't work in VS.Net, even
> in VB.NET. There is no ActiveX control wizard
> for VB.NET or C#.NET.
>
> So, once again, anyone know of any way to
> make a C# control for use in dockable container?