Solved

runtime error '453' Can't find DLL entry point GetCurrentDirectory in kernel32

Posted on 2003-12-08
4
2,571 Views
Last Modified: 2008-02-01
i'm attempting to make a GetCurrentDirectory function call in my form_load routine but get the error stated in the subject

any help would be appreciated!!!

the following is my code



Private Declare Function GetCurrentDirectory Lib "kernel32" ( _
                                  ByVal nBufferLength As Long, _
                                  ByVal lpBuffer As String) As Long

Public strPath as String


Private Sub Form_Load()
Dim lngTemp As Long
 
  strPath = String(255, 0)
 
  lngTemp = GetCurrentDirectory(255, strPath)
 
  MsgBox strPath
End Sub
0
Comment
Question by:howardsd
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
vascov earned 50 total points
Comment Utility
Hi howard,

try this:

Public Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

0
 

Author Comment

by:howardsd
Comment Utility
figured it out! had to declare the function uising an alias of "GetCurrentDirectoryA"

Private Declare Function GetCurrentDirectory Lib "kernel32" Alias "GetCurrentDirectoryA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

0
 

Author Comment

by:howardsd
Comment Utility
u beat me by 1 minute!

0
 
LVL 12

Expert Comment

by:vascov
Comment Utility
:)

Glad that you found it!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now