Thankx David, the DLL is managed C++ and I included it as a reference in the
project.
But when I then try to run it, it gives a DLLNotFoundException. What am I
doing wrong?
This is the code:
================================================== ==========================
=============
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click
Dim MorphID As Integer, rc As Short
' MorphID's value is returned
rc = LNSearch.InitializeLangData("D:\LangSearch\VB.NET\ LNSearch\DataFiles",
MorphID)
End Sub
Public Class LNSearch
Declare Auto Function InitializeLangData Lib
"D:\LangSearch\VC\LNSearchDLL\Release\LNSearchDLL. dll" (ByVal DictPath As
String, ByRef MorphID As Integer) As Short
End Class
================================================== ==========================
=============
"David Browne" <davidbaxterbrowne no potted
me**@hotmail.com> wrote in
message news:OC**************@TK2MSFTNGP14.phx.gbl...
"Hoss" <hm******@menanet.net> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl... Hi
I am an ASP.NET newbie and I have a VB.NET application I am trying to
write
in ASP.NET . The problem is that the application calls a DLL written
using VC++.NET . How do I call this DLL from the ASP.NET page? I'd appreciate
any
help, as I am stuck for time.
If it's managed C++ then just add a reference to it in your project. If
it's a COM dll, do the same (although different stuff will happen behind
the scenes). If it's an unmanaged, non-COM dll then you need to use P/Invoke.
David