1. Yakov Werde
  2. PowerBuilder
  3. Monday, 27 March 2017 14:53 PM UTC

With reference to modifications needed for 64 bit compatibility (long to longptr or longlong)

There are window pointer types and handles.  Both refer to objects in memory.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa383751(v=vs.85).aspx

Most of the pointer-type names begin with a prefix of P or LP. Handles refer to a resource that has been loaded into memory.

There are HWND types: Pointers to windows

For example

HWND WINAPI FindWindow(
  _In_opt_ LPCTSTR lpClassName,
  _In_opt_ LPCTSTR lpWindowName
);

OR

HWND WINAPI GetForegroundWindow(void);

I'd define this in PB as

Function longlong GetForegroundWindow() Library "user32.dll"   //returns Hwnd

or LongPtr GetForegroundWIndow.....


https://en.wikibooks.org/wiki/Windows_Programming/Handles_and_Data_Types

BOOL WINAPI FindClose(
  _Inout_ HANDLE hFindFile
);

This type is declared in WinNT.h as typedef PVOID HANDLE;

Is defined in PB as

Function boolean FindClose (long handle) library "KERNEL32.DLL"  //parm HANDLE

Does this need to change to LongLong handle?

Specifically, do we only need to refactor HWND types to LongPtr (LongLong) or also Handle Types

Thanks for sharing your knowledge

 

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 27 March 2017 15:40 PM UTC
  2. PowerBuilder
  3. # 1

https://msdn.microsoft.com/en-us/library/windows/desktop/aa384203%28v=vs.85%29.aspx

"64-bit versions of Windows use 32-bit handles for interoperability."

So there is a difference between a pointer and a handle. A pointer is the address of a memory location. A handle is akin to an array index.

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 27 March 2017 15:45 PM UTC
  2. PowerBuilder
  3. # 2

LPCTSTR:

L(long) P(pointer) C(constant) T(unicode)STR(string)

in plain english:  long pointer to a constant unicode string

Constant because the values aren't being changed by the function

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.