Solved

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

Posted on 2011-03-15
6
411 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
ID: 35136587
What platform are you running this on? User32.dll may not be available on the platform.
0
 
LVL 49

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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 49

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 49

Expert Comment

by:Gustav Brock
ID: 35154781
You are welcome!

/gustav
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

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. …
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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