Solved

GetShortPathName API said, "No Entry Point in kernel32.DLL"

Posted on 1998-05-17
2
424 Views
Last Modified: 2012-05-04
What is wrong with this code?

Private Declare Function GetShortPathName Lib "kernel32" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long

Private Sub Form_Load()
Dim strShort As String
Dim nLenShort As Long
nLenShort = 0

    strShort = Space(255)
    ' strShort = String(255," ")

    GetShortPathName "C:\Program Files", strShort, nLenShort
End Sub


This I get an error saying, "No Entry Point in the kernel32.dll".  

I'm running Win95 with IE4.01 and VB5 Enterprise..
0
Comment
Question by:Chizl
2 Comments
 
LVL 4

Accepted Solution

by:
yowkee earned 50 total points
ID: 1452443
  Kernel32.dll contains function GetShortPathNameA (ANSI) and GetShortPathNameW (Unicode), instead of GetShortPathName. Thus, you should declare the function as:

Private Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" _
(ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, _
ByVal cchBuffer As Long) As Long

'Then,

Private Sub Form_Load()
   
    Dim lRtn As Long
    Dim sShort As String * 256
   
    lRtn = GetShortPathName("C:\Program Files\", sShort, 256)
    MsgBox sShort
End Sub

0
 
LVL 4

Author Comment

by:Chizl
ID: 1452444
Thanx
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 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

17 Experts available now in Live!

Get 1:1 Help Now