0

I have an old VB6 COM DLL and have rewritten the code in a C# Class Library but need to be able to create a DLL to replace the current one. The DLLs created by building the new project cannot be registered through the command prompt. I tried first (as administrator):

regsvr32 Converter.dll

And it failed with:

The module Converter.dll was loaded but the entry-point DllRegisterServer was not found.

Make sure that "Converter.dll" is a valid DLL or OCX file and then try again.

Then I tried this script:

RegAsm.exe -tlb -codebase Converter.dll

And I got back that RegAsm.exe is not recognized as a command.

The current VB6 DLL is called from XML passed through a remote server application.

Since viewing the post sent to me in a comment, I have ran into another problem when building this DLL, and that is I need to reference Adobe Illustrator but the .aip file I need to reference is invalid when the project is et up for COM. I get back

"Please make sure that the file is accessible, and that it is a valid assembly or COM component".

One more edit: I upgraded Illustrator to the newest version and that issue was corrected. I grabbed the DLL from the /bin/Release directory and tried regsvr32 but once again received:

The module "Converter.dll" was loaded but the entry point DllRegisterServer was not found. Make sure that "Converter.dll" is a valid DLL or OCX file and then try again.

Matt
  • 109
  • 1
  • 12
  • 1
    "it failed" is not a valid description of a problem. – GSerg Apr 10 '20 at 19:28
  • 4
    Possible duplicate of [Turn a simple C# DLL into a COM interop component](https://stackoverflow.com/questions/7092553/turn-a-simple-c-sharp-dll-into-a-com-interop-component) – GSerg Apr 10 '20 at 19:30
  • @GSerg when I ran the batch file as administrator it did not do anything, did not even open a command prompt. Also I created this request after looking at the link you provided. – Matt Apr 10 '20 at 19:34
  • First open the command prompt manually, then run the command in it, and observe the output. – GSerg Apr 11 '20 at 06:46
  • @Matt Definitive way to know if it succeeded is to go look in the registry after trying to register it. Search by programmatic ID. – tcarvin Apr 14 '20 at 12:35
  • What error did RegAsm give you? And have you properly exposed the C# class for COM interop? – R.J. Dunnill Apr 14 '20 at 15:12
  • This seems to be a duplicate, as noted already. But it also is lacking any detail and is too broad... I suggest after reading the other question(s) on this topic either post a new, detailed question, or update this one with some specifics of what your code is and what the exact problem is. This can be a complex or at least confusing topic but without details its hard to provide good help. Good luck :) – StayOnTarget Apr 16 '20 at 15:08
  • @Matt what is it about the other question that doesn't answer this one? – StayOnTarget Dec 08 '20 at 18:17
  • have you set assembly cs file `[assembly: ComVisible(true)]` and in your class you need to expose as interfaceId and other properties `[ComClass(Class.ClassId, Class.InterfaceId,Class.EventsId)] [ComVisible(true)] public Class.. ]` – coder_b Dec 08 '20 at 18:54
  • I am referencing Adobe Illustrator in this project. After following the instructions in the post @GSerg referenced, I'm unable to reference the ScriptingSupport.aip file needed to run my code. I get back "Please make sure that the file is accessible, and that it is a valid assembly or COM component". – Matt Dec 08 '20 at 19:21
  • What is scriptingsupport.aip ? Is it a DLL of some kind? – StayOnTarget Dec 09 '20 at 19:19
  • @UuDdLrLrSs A .aip file (Adobe Illustrator Plugin) is functionally the same as a DLL but does not have the same extension. – Matt Dec 10 '20 at 20:12
  • Is it a .NET DLL? COM DLL? It makes a big difference... – StayOnTarget Dec 10 '20 at 20:14
  • [How to set up an C# class as COM-callable.](https://stackoverflow.com/questions/36335382/how-can-i-share-an-interface-between-vb6-and-c/63250720#63250720) – R.J. Dunnill Jan 26 '21 at 04:25

0 Answers0