1

As this link :

RegSvr32 is only for win32 dlls, and as far as I know .NET dlls cannot be registered with regsvr32

. So how to create dll that register with regsvr32?

MHM
  • 261
  • 1
  • 2
  • 15
  • Possible duplicate of [How do I register a COM DLL written in C# with Regsvr32?](http://stackoverflow.com/questions/4198583/how-do-i-register-a-com-dll-written-in-c-sharp-with-regsvr32) – Bill Tür stands with Ukraine Aug 21 '16 at 08:57
  • You can't do that with C# as you can't create an unmanaged dll with it. But why do you want to? Regasm does the same job for a managed dll. – Bill Tür stands with Ukraine Aug 21 '16 at 09:39
  • the dll (ocx file) that register with regsvr32 is not depand on .Net frame work.this type of dll is worked on every system and it is easy to use in Delphi. So how can I create ocx file (dll) ? in which IDE? is it possible to create this dll type in visual c++? – MHM Aug 21 '16 at 09:45
  • 1
    Yes, C++ can be used to create unmanaged COM dll's – Bill Tür stands with Ukraine Aug 21 '16 at 10:12
  • @MHM you can use visual studio to create a MFC ActiveX project or ATL project. – neohope Aug 22 '16 at 08:32
  • @MHM you can also create an C# dll project and make it COM visible. but you have to regist it by gacutil RegAsm and RegSvcs instead of regsvr32. – neohope Aug 22 '16 at 08:37
  • @neohope. thanks. I am searching for best reference to create ActiveX MFC . there is no good on MSDN. because I am beginner and I want a little tutorial that show it step by step with image in visual stdio 2015. Do you reference like this? – MHM Aug 22 '16 at 09:07
  • Making your technology choices based on *how* a component ends up getting registered seems somewhat wrong. Why is component registration the most important technical constraint here? – Damien_The_Unbeliever Aug 22 '16 at 09:22

1 Answers1

3

You can read through these:

A Beginner Tutorial for Writing Simple COM/ATL DLL For VS2012

A Beginner Tutorial for Writing Simple COM/ATL DLL and Using it with .NET

MHM
  • 261
  • 1
  • 2
  • 15
neohope
  • 1,822
  • 15
  • 29
  • really thans. Is ATL make ocx like MFC activex? – MHM Aug 22 '16 at 09:15
  • 2
    ATL and MFC are quite different. But yes, they can both build COM projects. – neohope Aug 22 '16 at 09:17
  • >The short answer is, if you are not doing anything "fancy", use ATL. It's great for simple user interfaces with COM thrown in.The long answer: MFC was built in the early 90s to try out this new language called C++ and apply it to Windows. It made Office like features available to the development community when the OS didn't have them yet.[reasource](http://stackoverflow.com/questions/7212051/whats-the-fundamental-difference-between-mfc-and-atl) – MHM Aug 22 '16 at 09:29