1. Jason Ross
  2. PowerBuilder
  3. Wednesday, 13 October 2021 00:40 AM UTC

I have a deployed version of powerbuilder 2021 build 1288 and when accessing a calendar dropdown the application crashes with this error.

I have these two functions in my code which call the user32.dll which is directly where the error message is pointing to. I have a copy of user32.dll in my deployed workspace and for some reason the error is still occurring - other .dlls seem to be working fine.

FUNCTION ulong win_GetFocus() ALIAS FOR "GetFocus" LIBRARY "user32.dll"

FUNCTION ulong win_GetClassName(ulong hwnhttps://i.stack.imgur.com/7PmNS.pngd, ref string cname, int buf) ALIAS FOR "GetClassNameW" LIBRARY "user32.dll"


Who is viewing this page
Accepted Answer
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 13 October 2021 01:18 AM UTC
  2. PowerBuilder
  3. # Permalink

The correct definition for GetClassName is:

Function long GetClassName ( longptr hWnd, Ref string lpClassName, long nMaxCount ) Library "user32.dll" Alias For "GetClassNameW"

The string argument must be prefilled with the Space function before calling it. MaxCount is the number passed to the Space function. I would use 250.

There are no comments made yet.
Jason Ross Accepted Answer Pending Moderation
  1. Friday, 15 October 2021 01:39 AM UTC
  2. PowerBuilder
  3. # 1

This worked, greatly appreciate the help and quick response, thanks.

There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 13 October 2021 04:59 AM UTC
  2. PowerBuilder
  3. # 2

In addition to what Roland has pointed out, I do not think it wise to place a copy of a Windows system DLL in your application's deployed workspace/folder.

  1. Jason Ross
  2. Friday, 15 October 2021 01:41 AM UTC
Thanks, makes sense, was unsure if it was correctly referencing any DLLs initially so that's why I put it in the deployed workspace but will take it out now.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.