Referencing a non-self-registering DLL

G

Guest

Hi All

I have a DLL (nahd.dll) that has been supplied to me will a PBX phone
system. According to the documentation it is to allow developers to write
there own applications to monitor the system.

Now when I try to register this DLL I get an error.
“DLL RegisterServer entry point not foundâ€
According to Microsoft this means it is not a DLL. I can view it using
Dependency Walker and it has all the events mentioned in the documentation.
And I have downloaded a new copy of the DLL so it can not be corrupt.

I think that this is a non-self-registering DLL.

So my problem is that I have never worked with one of these before and I
don’t know how to. I am used to using DLL’s that you register and use as COM
objects.

I have tried to reference it as I would a standard COM object from CSharp
but I got an error saying that it is not a COM Object.

I am at a bit of a loss cos I have looked round the net and can’t seem to
find any samples dealing with this problem. Even VB samples would do.

This is the Webpage for the company that supplies the DLL
http://www.avaya.co.uk/Support/Technical_Support/Product_Information/default.asp

If you look down the page to the VoiceMail Pro section there is a link to
the Hotel DLL.
Down load that and unzip it and that has the nahd.dll and the documentation
in it. You can see for your self what I mean.

Please any help on how I have to use this would be great.
 
N

Nicholas Paldino [.NET/C# MVP]

Ian,

There is no such thing as a non-self-registering DLL. If you are
refering to an in-process COM server, then it will export the functions
necessary to register itself.

Also, DLLs can contain a number of different things, exporting them all
in different ways. They can export regular functions, be a COM in process
server, a MFC dll, a .NET dll, the list goes on and on.

Based on the documentation (sorry, I won't run the EXE from the site),
what kind of functionality does it export? My guess is that it is not a COM
in process server, but something else.

Hope this helps.
 
D

Dan Bass

This file is not a COM object, but it is a valid DLL. All a DLL is, is a
block of code, which must have some interface exposed via some sort of
definition file. A COM object is a technology and set of standards that
happen to sit inside of DLL files.

If you look at the "Nahd.Def" file, you'll see the methods that this DLL
exports.

You'll need to do a few things here:

1. Create the LIB
The lib is created by running the "lib" command from the command prompt
in the folder containing the unzipped files. The batch file puts it like
this: lib /DEF:nahd.def /OUT:nahdcoff.lib

2. Extract the header file
The .H file is found in the document that comes with this package (last
two pages or so). Cut and paste this into a new text file called
"nahdcoff.h"

3.1. Use PInvoke to late bind to the dll from c#
Read up on this here:
http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp
[beware line breaks]

OR

3.2 Create a new unmanaged C++ COM project that simply references the .H
file, and links to the .Lib file to produce a COM DLL, which you can then
reference via C#.


The final alternative is to ask the manufacturer for an updated module (and
hope that one exists), with a COM, or event better, .Net interface.
 
G

Guest

Thanks Dan

I thought it was something strange. But i never would have figured all that
out.

I assume that this is because it is from the oldy days

Ian




Dan Bass said:
This file is not a COM object, but it is a valid DLL. All a DLL is, is a
block of code, which must have some interface exposed via some sort of
definition file. A COM object is a technology and set of standards that
happen to sit inside of DLL files.

If you look at the "Nahd.Def" file, you'll see the methods that this DLL
exports.

You'll need to do a few things here:

1. Create the LIB
The lib is created by running the "lib" command from the command prompt
in the folder containing the unzipped files. The batch file puts it like
this: lib /DEF:nahd.def /OUT:nahdcoff.lib

2. Extract the header file
The .H file is found in the document that comes with this package (last
two pages or so). Cut and paste this into a new text file called
"nahdcoff.h"

3.1. Use PInvoke to late bind to the dll from c#
Read up on this here:
http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp
[beware line breaks]

OR

3.2 Create a new unmanaged C++ COM project that simply references the .H
file, and links to the .Lib file to produce a COM DLL, which you can then
reference via C#.


The final alternative is to ask the manufacturer for an updated module (and
hope that one exists), with a COM, or event better, .Net interface.

ian said:
Hi All

I have a DLL (nahd.dll) that has been supplied to me will a PBX phone
system. According to the documentation it is to allow developers to write
there own applications to monitor the system.

Now when I try to register this DLL I get an error.
"DLL RegisterServer entry point not found"
According to Microsoft this means it is not a DLL. I can view it using
Dependency Walker and it has all the events mentioned in the
documentation.
And I have downloaded a new copy of the DLL so it can not be corrupt.

I think that this is a non-self-registering DLL.

So my problem is that I have never worked with one of these before and I
don't know how to. I am used to using DLL's that you register and use as
COM
objects.

I have tried to reference it as I would a standard COM object from CSharp
but I got an error saying that it is not a COM Object.

I am at a bit of a loss cos I have looked round the net and can't seem to
find any samples dealing with this problem. Even VB samples would do.

This is the Webpage for the company that supplies the DLL.
http://www.avaya.co.uk/Support/Technical_Support/Product_Information/default.asp

If you look down the page to the VoiceMail Pro section there is a link to
the Hotel DLL.
Down load that and unzip it and that has the nahd.dll and the
documentation
in it. You can see for your self what I mean.

Please any help on how I have to use this would be great.

--

Thanks Heaps

Ian
 
D

Dan Bass

not that old, it makes me feel old! ;o)

That's how we C++ programmer's did things before .Net arrived. COM from C++
(and in general) is very complicated, wrapping up a simple DLL with the
intention of exposing a few methods is far simpler.

We're just spoilt with the interop work that goes on under the hood when
adding references to out .Net projects...



ian said:
Thanks Dan

I thought it was something strange. But i never would have figured all
that
out.

I assume that this is because it is from the oldy days

Ian




Dan Bass said:
This file is not a COM object, but it is a valid DLL. All a DLL is, is a
block of code, which must have some interface exposed via some sort of
definition file. A COM object is a technology and set of standards that
happen to sit inside of DLL files.

If you look at the "Nahd.Def" file, you'll see the methods that this DLL
exports.

You'll need to do a few things here:

1. Create the LIB
The lib is created by running the "lib" command from the command
prompt
in the folder containing the unzipped files. The batch file puts it like
this: lib /DEF:nahd.def /OUT:nahdcoff.lib

2. Extract the header file
The .H file is found in the document that comes with this package
(last
two pages or so). Cut and paste this into a new text file called
"nahdcoff.h"

3.1. Use PInvoke to late bind to the dll from c#
Read up on this here:
http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp
[beware line breaks]

OR

3.2 Create a new unmanaged C++ COM project that simply references the .H
file, and links to the .Lib file to produce a COM DLL, which you can then
reference via C#.


The final alternative is to ask the manufacturer for an updated module
(and
hope that one exists), with a COM, or event better, .Net interface.

ian said:
Hi All

I have a DLL (nahd.dll) that has been supplied to me will a PBX phone
system. According to the documentation it is to allow developers to
write
there own applications to monitor the system.

Now when I try to register this DLL I get an error.
"DLL RegisterServer entry point not found"
According to Microsoft this means it is not a DLL. I can view it using
Dependency Walker and it has all the events mentioned in the
documentation.
And I have downloaded a new copy of the DLL so it can not be corrupt.

I think that this is a non-self-registering DLL.

So my problem is that I have never worked with one of these before and
I
don't know how to. I am used to using DLL's that you register and use
as
COM
objects.

I have tried to reference it as I would a standard COM object from
CSharp
but I got an error saying that it is not a COM Object.

I am at a bit of a loss cos I have looked round the net and can't seem
to
find any samples dealing with this problem. Even VB samples would do.

This is the Webpage for the company that supplies the DLL.
http://www.avaya.co.uk/Support/Technical_Support/Product_Information/default.asp

If you look down the page to the VoiceMail Pro section there is a link
to
the Hotel DLL.
Down load that and unzip it and that has the nahd.dll and the
documentation
in it. You can see for your self what I mean.

Please any help on how I have to use this would be great.

--

Thanks Heaps

Ian
 
G

Guest

Hi

Ok... I can from a VB6 background and am now learning C# so i have never
done any C++.

I have only been developing for 4 years.

Thanks for all your help

Ian



Dan Bass said:
not that old, it makes me feel old! ;o)

That's how we C++ programmer's did things before .Net arrived. COM from C++
(and in general) is very complicated, wrapping up a simple DLL with the
intention of exposing a few methods is far simpler.

We're just spoilt with the interop work that goes on under the hood when
adding references to out .Net projects...



ian said:
Thanks Dan

I thought it was something strange. But i never would have figured all
that
out.

I assume that this is because it is from the oldy days

Ian




Dan Bass said:
This file is not a COM object, but it is a valid DLL. All a DLL is, is a
block of code, which must have some interface exposed via some sort of
definition file. A COM object is a technology and set of standards that
happen to sit inside of DLL files.

If you look at the "Nahd.Def" file, you'll see the methods that this DLL
exports.

You'll need to do a few things here:

1. Create the LIB
The lib is created by running the "lib" command from the command
prompt
in the folder containing the unzipped files. The batch file puts it like
this: lib /DEF:nahd.def /OUT:nahdcoff.lib

2. Extract the header file
The .H file is found in the document that comes with this package
(last
two pages or so). Cut and paste this into a new text file called
"nahdcoff.h"

3.1. Use PInvoke to late bind to the dll from c#
Read up on this here:
http://msdn.microsoft.com/library/d.../html/cpconconsumingunmanageddllfunctions.asp
[beware line breaks]

OR

3.2 Create a new unmanaged C++ COM project that simply references the .H
file, and links to the .Lib file to produce a COM DLL, which you can then
reference via C#.


The final alternative is to ask the manufacturer for an updated module
(and
hope that one exists), with a COM, or event better, .Net interface.

Hi All

I have a DLL (nahd.dll) that has been supplied to me will a PBX phone
system. According to the documentation it is to allow developers to
write
there own applications to monitor the system.

Now when I try to register this DLL I get an error.
"DLL RegisterServer entry point not found"
According to Microsoft this means it is not a DLL. I can view it using
Dependency Walker and it has all the events mentioned in the
documentation.
And I have downloaded a new copy of the DLL so it can not be corrupt.

I think that this is a non-self-registering DLL.

So my problem is that I have never worked with one of these before and
I
don't know how to. I am used to using DLL's that you register and use
as
COM
objects.

I have tried to reference it as I would a standard COM object from
CSharp
but I got an error saying that it is not a COM Object.

I am at a bit of a loss cos I have looked round the net and can't seem
to
find any samples dealing with this problem. Even VB samples would do.

This is the Webpage for the company that supplies the DLL.
http://www.avaya.co.uk/Support/Technical_Support/Product_Information/default.asp

If you look down the page to the VoiceMail Pro section there is a link
to
the Hotel DLL.
Down load that and unzip it and that has the nahd.dll and the
documentation
in it. You can see for your self what I mean.

Please any help on how I have to use this would be great.

--

Thanks Heaps

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top