Solved

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

Posted on 1998-05-17
2
452 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
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…

710 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