Solved

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

Posted on 2011-03-15
6
419 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 84
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
Industry Leaders: 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 Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

756 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