Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-15
6
Medium Priority
?
431 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 52

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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 52

Accepted Solution

by:
Gustav Brock earned 2000 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 52

Expert Comment

by:Gustav Brock
ID: 35154781
You are welcome!

/gustav
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

636 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