Re: VB6 app cannot copy dll to system32
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Wed, 2 May 2007 21:23:19 -0400
"Michael J. Wheeler" <MichaelJWheeler@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:4CD54C4C-151A-450D-9F89-3B0537E02551@xxxxxxxxxxxxxxxx
Mike,
I am not hard coding a fully qualified path to the DLL. I am basically
just
doing ' Lib "mydll.dll" '... I've tried having the DLL in the same
directory
as the executable, but it gives me a runtime error 53.. file not found and
my
DLL is listed.
It was just a shot in the dark....but I've seen it before so thought it was
worth bringing up.
I'm not sure about that runtime error though. As I recall, that's not the
error you get if the DLL can't be found for a declared (external) function.
I'll test something real quick....
Nope. That's the error. Here's the code I tested:
-----BEGIN CODE
Private Declare Function GetWindowsDirectory Lib "C:\kernel32" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long
Private Function WinDir() As String
Dim sBuffer As String
On Error GoTo EH
sBuffer = String$(260, 0)
Call GetWindowsDirectory(sBuffer, 260)
WinDir = sBuffer
Exit Function
EH:
MsgBox Err.Description & " (" & Err.Number & ")"
End Function
Private Sub Form_Load()
MsgBox WinDir
End Sub
-----END CODE
I coulda sworn it was a different error (at least the number) than VB's
*standard* "file not found" error. Guess I was wrong.
--
Mike
Microsoft MVP Visual Basic
.
- Follow-Ups:
- Re: VB6 app cannot copy dll to system32
- From: Michael J. Wheeler
- Re: VB6 app cannot copy dll to system32
- References:
- Re: VB6 app cannot copy dll to system32
- From: Karl E. Peterson
- Re: VB6 app cannot copy dll to system32
- From: MikeD
- Re: VB6 app cannot copy dll to system32
- Prev by Date: Re: VB6 app cannot copy dll to system32
- Next by Date: Re: VBA 2003, Excel: LIKE operator to check number fails
- Previous by thread: Re: VB6 app cannot copy dll to system32
- Next by thread: Re: VB6 app cannot copy dll to system32
- Index(es):
Relevant Pages
|