Page 1 of 1

FreestylerCommunicator for 64bit

Posted: August 24th, 2019, 6:40 pm
by pixtur
Hi,

I am working on a tooll.io Operator that forwards data to FreeStyler. I played around with Matt's FreestylerCommunicator / FreestylerConnection DLL but they only seem to work with x86 applications. Is there any way to make this DLL work also from a 64bit application?

BR,
pixtur

Re: FreestylerCommunicator for 64bit

Posted: August 30th, 2019, 6:03 pm
by Mattotone
Freestyler is a 32bit program, iv never had much look getting send message to work from 64bit and would compile for x86.

docs.Microsoft.com
Shared Memory—When using shared memory, be aware that a structure in a 32-bit process may have a different size and layout than the same structure in a 64-bit process. This is especially true for structures that contain pointers or handles.
Pointer Truncation—Although a 32-bit application can use the LONGLONG data type to store a 64-bit value, there are instances where no Windows API element exists that would enable the 32-bit application to receive a 64-bit value from a 64-bit process, or to send a 64-bit value to a 64-bit process. For example, the GetWindowLongPtr and SendMessage functions truncate all pointer values, leaving the 32-bit application with a useless value.
Handles—Because kernel32 and user32 handles are only 32-bit significant in both 32-bit and 64-bit processes, they can be transferred between processes without a problem. However, some items that Windows defines as handles are really just wrapped pointers (for example, HTREEITEM). These "handles" will be truncated if they are passed from a 64-bit process to a 32-bit process.
WinEvent Hook Functions—To register an in-context hook function with a 32-bit server process, the hook function must reside in a 32-bit DLL. Similarly, to register an in-context hook function with a 64-bit server process, the hook function must reside in a 64-bit DLL. If an assistive technology application attempts to register an in-context hook function with a server that has a different bit-depth, events will still be delivered to the hook function, but they will be delivered out-of-context. For more information, see WinEvents and In-Context and Out-of-Context Hook Functions.

Re: FreestylerCommunicator for 64bit

Posted: August 30th, 2019, 6:09 pm
by pixtur
Thanks for your reply. I guess this means, that I have to send TCP/IP commands.
I wasn't sure, but did you also write a wrapper for this, as well?