1. Kevin Teynor
  2. PowerBuilder
  3. Wednesday, 9 January 2019 18:27 PM UTC

Migrating from PB 8.0.4 to PB 2017 R2.

 

When hovering over labels in a tree, we are getting foreign language characters in the expanded text.

Also, when calling GetUsernameA or GetComputerNameA:

 

GetUserNameA

GetComputerNameA

 

Fails running PB2017 on both Windows Server 2012 and 2016.

 

Works fine running PB8 on Windows Server 2012.

Attachments (2)
Accepted Answer
Bruce Armstrong Accepted Answer Pending Moderation
  1. Wednesday, 9 January 2019 19:01 PM UTC
  2. PowerBuilder
  3. # Permalink

You didn't show the declaration of those external function calls.  It appears you are calling the ANSI versions, and PowerBuilder has been Unicode since version 10.  If the external function declaration doesn't have ";ANSI" after it, PowerBuilder will call it expecting Unicode text back and the strange characters are a result of the mismatch.

 

 

Comment
There are no comments made yet.
Kevin Teynor Accepted Answer Pending Moderation
  1. Thursday, 10 January 2019 18:14 PM UTC
  2. PowerBuilder
  3. # 1

Any thoughts on the treeview issue?

I attached videos demonstrating the problem.  I don't think we override the default hover behavior, so I'm not sure what to do about this.

 

Attachments (1)
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 9 January 2019 21:19 PM UTC
  2. PowerBuilder
  3. # 2

Hi Kevin;

   You should be using instead ...

  • GetUserNameW or GetUserNameExW
  • GetComputerNameW

 

Declarations ...

  • FUNCTION Boolean GetUserName ( ref string lpBuffer, ref Integer nSize ) Library "ADVAPI32.DLL" ALIAS FOR "GetUserNameW"
  • FUNCTION  Boolean  GetUserNameEx ( Integer nameformat, ref string username, ref Integer namelen ) Library "Secur32.dll" ALIAS FOR "GetUserNameExW"
  • FUNCTION Long GetComputerName ( Ref String lpbuffer, Ref uLong nsize ) Library "KERNEL32.dll" alias for "GetComputerNameW"

HTH
Regards .... Chris

Comment
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.