Solved

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

Posted on 2011-03-15
6
386 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
  • 3
  • 2
6 Comments
 
LVL 84
Comment Utility
What platform are you running this on? User32.dll may not be available on the platform.
0
 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 49

Accepted Solution

by:
Gustav Brock earned 500 total points
Comment Utility
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
Comment Utility
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 49

Expert Comment

by:Gustav Brock
Comment Utility
You are welcome!

/gustav
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

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