Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1998-05-17
2
Medium Priority
?
465 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
yowkee earned 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

670 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