K
Keith G Hicks
I'm an experienced foxpro, vba, delphi, sql programmer but this is something
new to me. I'm creating a pretty simple vb.net exe (scantextfiles.exe) that
will run on a server and read some text files into a database. But I also
need to create a stand alone function that can be called by
scantextfiles.exe. This stand alone function will use the MeasureString
method to get the length of some of the text in the text files. I'm not
putting that function in scantextfiles.exe because I need to call it from a
couple other places as well. So I'm thinking this needs to be a dll that I
can just plop into a folder somewhere. But I have really no idea how to do
that. I've never created a dll before. I'm not sure that's the best way to
go anyway. To make things a little more complicated (maybe) I'm using vb
2005 express to do all of this.
I created a test dll project and my class1.vb code is as follows (just to
try all this out):
Imports System.Math
Public Class Class1
Private Function fncSqRt(ByVal inputval As Double) As Double
If inputval < 0 Then
Return -1
Else
Return Sqrt(inputval)
End If
End Function
End Class
I compiled the dll and so I have TestDLL.dll sitting in my release folder.
Ok, so now what? I really am not sure if I'm headed in the right
direction. I'm also not sure how to call the dll from scantextfiles.exe. I
know a lot of this is going to sound pretty basic but like I said, this is a
new area to me. Any help or pionting me in the right direction would be
appreciated.
TIA,
Keith
new to me. I'm creating a pretty simple vb.net exe (scantextfiles.exe) that
will run on a server and read some text files into a database. But I also
need to create a stand alone function that can be called by
scantextfiles.exe. This stand alone function will use the MeasureString
method to get the length of some of the text in the text files. I'm not
putting that function in scantextfiles.exe because I need to call it from a
couple other places as well. So I'm thinking this needs to be a dll that I
can just plop into a folder somewhere. But I have really no idea how to do
that. I've never created a dll before. I'm not sure that's the best way to
go anyway. To make things a little more complicated (maybe) I'm using vb
2005 express to do all of this.
I created a test dll project and my class1.vb code is as follows (just to
try all this out):
Imports System.Math
Public Class Class1
Private Function fncSqRt(ByVal inputval As Double) As Double
If inputval < 0 Then
Return -1
Else
Return Sqrt(inputval)
End If
End Function
End Class
I compiled the dll and so I have TestDLL.dll sitting in my release folder.
Ok, so now what? I really am not sure if I'm headed in the right
direction. I'm also not sure how to call the dll from scantextfiles.exe. I
know a lot of this is going to sound pretty basic but like I said, this is a
new area to me. Any help or pionting me in the right direction would be
appreciated.
TIA,
Keith