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.
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.