Solved

How to create a DLL using Visual Studio C# that registers with regsvr32 NOT regasm ?

Posted on 2007-11-28
7
768 Views
Last Modified: 2013-11-26
Hi,
I'm trying to create a DLL to use in an application that is not .net.  (Actually Microsoft Dynamics Nav not that it should matter)

Anyways I created a class library and compiled to dll.  However I can only register it using regasm /tlb option.  This in return always gives me the Entry Point not found in the other application.  So my feeling is that I need to build some interface or something on top ?
public class TestDLL
    {
        private string myString = "EMPTY";
 
        public Tenging()
        {
        }
 
        public string MyProperty
        {
            get
            {
                return myString;
            }
            set
            {
                myString = MyProperty;
            }
        }
    }

Open in new window

0
Comment
Question by:Pall Palsson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 20370480
you don't have the choice to use regasm.
0
 

Author Comment

by:Pall Palsson
ID: 20372707
First off the code snipped is wrong in the way that the constructor should of course be of TestDLL().

Anyways I don't understand what you mean by that !  Right now my only choice seems to be regasm but the result is not what I expect as when I try and use the DLL I always get the DLL Entry Point not found error.

Upon further reading I'm starting to think that I need to write some sort of COM wrapper or Interop.

Does anyone have a link to a good sample ?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 20373052
0
Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

 

Author Comment

by:Pall Palsson
ID: 20378594
Perhaps I'm not explaining the problem correctly.

What I want to accomplish is making a "old school" COM DLL using c#.net.  I can make a DLL that publishes its interface to .Net but not Win32.

I tried making a simple Class library using the ComClass in VB.net but that gave me the same result.  The Inteface (methods, attributes etc) is not published so when I open the DLL in a program like DLL Export Viewer it comes up empty.
0
 

Author Comment

by:Pall Palsson
ID: 20440572
Got it to work

Application->Assembly Information->Check Make Assembly COM-Visible
Build->Settings->Check Register for COM Interop
Signing->Check Sign the Assembly
using System.Runtime.InteropServices;
 
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
public interface ITestDLL
{
    [DispId(1)]
    string MyProperty {get; set; }
}
 
[ClassInterface(ClassInterfaceType.None)]
[ProgId("<Namespace>.TestDLL")]
public class TestDLL : ITestDLL
{
    etc.

Open in new window

0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 20615325
PAQed with points refunded (250)

Computer101
EE Admin
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

634 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