First C# / .NET project.... ActiveX DLL?

Posted on 2003-04-01
Medium Priority
Last Modified: 2006-11-17
I am a long time VB Programmer, so writing vb activex dll's is pretty easy for me, but I have a need to do one in c# (mainly I want to learn c#).

Please let me know if what I want to do it possible:
I want to create an activex dll that loads from a local html page (non-web server).  
The DLL will basically open a file and read/write to it based on commands sent to it from the html page.

Does anyone have any samples that do this? or something like it?


Question by:MeyerCa
  • 2
LVL 11

Expert Comment

ID: 8246409
Where will this local webpage be located ?

Will you access this DLL from the .NET framework or from a "simple" asp page?

B.t.W: I am forced to do the same transition....

I found the easiest way to get an answer of how this should work in C# or VB.NET is to create an "old" project in VB6 and open it in VB.NET and let the IDE do the translation. I know this is cheap but it usulally works ;)


Author Comment

ID: 8246437
The HTML page would be located on a CD.  My App will install the ActiveX object, then the HTML will use it.

It wouldnt be running throught the .Net framework, it should just be an activeX object embedded in the HTML page, and Ill probably be using javascript to make calls to it.


Accepted Solution

cral_almodovar earned 300 total points
ID: 8260459
Bad news: It's not possible to create ActiveX DLLs in .NET, using C# or any other language (COM and ActiveX technologies are considered "legacy" stuff in the .NET world). The closest equivalent of an ActiveX DLL in the .NET Framework is the .NET class library.

Good news: .NET provides extensive COM/ActiveX  interoperability features. For example, you can use the "regasm.exe" utility to create a "wrapper" to a .NET class library so that you can use the library from your COM-based applications (i.e. you can add a reference to the library in VB's Project+References window).

What you can do: Create a .NET class library (using C#, VB.NET, or any other language supported by .NET) and create a "wrapper" for it using the "regasm.exe" utility that comes with the .NET Framework SDK. Your application can now use the .NET class library as if it's an ActiveX DLL.

Note that there will be some security considerations if you call the .NET class library from an HTML page.

Author Comment

ID: 8261422
Thank you much! this is exactly what I was looking for.


Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question