Where is my ActiveX DLL project template in VS 2005?

In VB6, the ActiveX DLL appears as a project template, but in VS 2005+ there is no such thing. Where is my good old ActiveX DLL template? Thank you very much in advance.

+1


source to share


4 answers


Several concepts; .NET Assemblies are functional equivalents of ActiveX DLLs in .NET langauges..NET classes and methods can be decorated with an attribute that has different meanings in different contexts. A .NET assembly can be converted to an ActiveX / COM DLL (or OCX) using various attributes to assign the correct GUIDs.

A basic overview of installing a .NET COM assembly is here .

Please note that when searching on Google, you must enable VB6.NET and COM (not ActiveX). COM generates more requests because it is the underlying technology behind the term ActiveX.



The MSDN related article shows basic COM configuration for a .NET class. The attribute here is the ComClass attribute.

<ComClass(ComClass1.ClassId, ComClass1.InterfaceId, ComClass1.EventsId)> _
Public Class ComClass1

#Region "COM GUIDs"
    ' These  GUIDs provide the COM identity for this class 
    ' and its COM interfaces. If you change them, existing 
    ' clients will no longer be able to access the class.
    Public Const ClassId As String = "6DB79AF2-F661-44AC-8458-62B06BFDD9E4"
    Public Const InterfaceId As String = "EDED909C-9271-4670-BA32-109AE917B1D7"
    Public Const EventsId As String = "17C731B8-CE61-4B5F-B114-10F3E46153AC"
#End Region

    ' A creatable COM class must have a Public Sub New() 
    ' without parameters. Otherwise, the class will not be 
    ' registered in the COM registry and cannot be created 
    ' through CreateObject.
    Public Sub New()
        MyBase.New()
    End Sub

End Class

      

There are other attributes that are especially useful if you are trying to sign a .NET assembly for an existing COM DLL or OCX. Finally, there are many different wizards in .NET to guide you through the tedious details.

+2


source


Try this: http://msmvps.com/blogs/pauldomag/archive/2006/08/16/107758.aspx



It describes how to create an activex control and use it in a web page. As far as I know, there is actually no ActiveX project template, as .NET does it differently. However, you can make your .Net elements visible to the COM world, as demonstrated by the above article.

+1


source


It's not entirely clear from your question, but if you want to be able to consume in VB6 (or some other com environment) something built in VS2005, you want to look at the Interop Forms Toolkit . This greatly simplifies the interaction between VB6 and VS2005. Now, if you really want to distribute these applications, installing what you've built becomes a lot more fun (hints: don't use the GAC, install DLL.Net in the same directory as the application executable, and learn how to use RegAsm.)

If you give a short description of what you want to use ActiveX.dll for (project library or User Control) and what environment you want to use it, more advice may be provided for you.

0


source


I don't know if this is what you are trying to do or not. But if you right-click on the Toolbox in Visual Studio, from the pop-up menu, choose Select Item ...

When the Select Toolbox Item dialog box appears , select the COM Components tab and check the COM components (components) that you want to add to the toolbar. I did this to add "Windows Media Player" to the toolbar and use it in C # Winform.

From this dialog you can access any COM, OCX or ActiveX controller loaded on your system.

0


source







All Articles