Access 97 & VB.Net DLL Issue

M

MattyM

Hello,

I have been looking for reference material on this all day today and I am
not sure if I am searching improperly or what, but I can't seem to find
what's going on. I read a post saying that DLL's had to be done in a special
way in order for it to work in Access 97, but haven't seen anything to
support that.

In any event, my issue is as follows; I have created a DLL in Vb.net (2005).
It's not a type library so I need to use a declare function in Access 97. The
DLL has a single class with a single public function. My access DB has a form
that calls the function, however when it does I get a 453: entry point error.

My declare code looks like (I tried it without the alias too and get the
same thing):

Public Declare Function DoAdd Lib
"C:\Projects\VB\testLib\testLib\obj\Debug\testLib.dll" Alias "Add" (ByVal one
As Double, ByRef two As Double) As Double

The code that calls it looks like:

Private Sub Command6_Click()

Dim dblOne As Double, dblTwo As Double

txtOne.SetFocus
dblOne = CDbl(txtOne.Text)
txtTwo.SetFocus
dblTwo = CDbl(txtTwo.Text)

txtResults.SetFocus
txtResults.Text = DoAdd(dblOne, dblTwo)

End Sub

and the procedure in VB.net looks like;

Public Function Add(ByVal val1 As Double, ByRef val2 As Double) As Double
If allowSum = True Then

sum = val1 + val2

' Return the sum of two input values
Return sum
Else
Return 0
End If
End Function

This is just a couple test applications that I am practicing with for an
upcoming project, that's why the examples are pretty straight forward. I am
sure I am just missing something, but can't figure out what. If anyone has
any ideas it would be great.

Thanks.
 
D

DAVID

By default, a .Net DLL is not a Windows DLL
have you addressed that issue?

Get a copy of the utility "depends.exe" to
look at the entry points in your DLL. If you
are lucky, it will just be the entry point
names are mangled. If you are unlucky, it
will be a com object instead of a windows
DLL.

(david)
 
M

MattyM

The .Net DLL issue is what I wondered about, but I hadn't found any good
documentation on it. I'll check out the depends.exe utility and see if it
helps, but I am betting it's the DLL.

Thanks for the assist!
 

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