Solved

New Issue in converting an old Access v 2.0 to newer version

Posted on 2011-03-15
6
425 Views
Last Modified: 2012-05-11
I'm getting a Run-time error '453'  can't find DLL entry point GetClassName in User32

with the highlighted line being  cch$ = wu_GetClassName(hwnd, stBuff, cchMax)


'------------------------------------------------------------------------
' FUNCTION    : wu_StWindowClass
'
' PURPOSE     : A simple cover function to the Windows API call.
'------------------------------------------------------------------------
Function wu_StWindowClass(hwnd As Long) As String
    Const cchMax = 255
    Dim stBuff As String * cchMax
    cch$ = wu_GetClassName(hwnd, stBuff, cchMax)
    If (hwnd& = 0) Then
        wu_StWindowClass = ""
    Else
        wu_StWindowClass = (Left$(stBuff, cch$))
    End If
End Function
0
Comment
Question by:kinerang
[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
  • 3
  • 2
6 Comments
 
LVL 85
ID: 35136587
What platform are you running this on? User32.dll may not be available on the platform.
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 35137050
You probably have something like this in your code:

Declare Function GetClassName Lib "User" (ByVal hWnd As Integer, ByVal lpClassName As String, ByVal nMaxCount As Integer) As Integer

which is a call to the 16-bit Windows API.
All of these must manually be recoded for Win32.

/gustav
0
 

Author Comment

by:kinerang
ID: 35143475
Thanks LSMConsulting:  and cactus_data:   the conversion is from Access version 2 to  Access 2003.
I have already updated  user to user32 , Integer to Long and the declare Function reads
Declare Function wu_GetClassName Lib "User32" Alias "GetClassName" (ByVal hwin&, ByVal stBuf$, ByVal cch$) As Long in its manually updated form.

That's why I'm puzzled at the message I have got on opening the main form
0
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!

 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 35145884
It's not that simple. Many function under Win32 have an appended A for ASCII or U for Unicode and Long replaces Integer:

Declare Function GetClassName Lib "user32" Alias "GetClassNameA" ( _
  ByVal hwnd As Long, _
  ByVal lpClassName As String, _
  ByVal nMaxCount As Long) _
  As Long

/gustav
0
 

Author Closing Comment

by:kinerang
ID: 35152816
YES  I knew about the Asci and Unicode issue and I don't know why I hadn't twigged before about that
Thanks Heaps Gustav .
Looks like all is working but I'll do other testing
thanks Paul
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 35154781
You are welcome!

/gustav
0

Featured Post

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 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