Hello,
I am currently working with the FSUIPC SDK for the C programming language and running into an issue. I am required to compile my end application in 64 bit, and it seems that the provided example C code does not work when compiled in 64 bit, though works as expected when compiled in 32 bit.
Initially, there was a problem with the call to CreateFileMapping in the FSUIPC_Open function, which would return an invalid handle error. I resolved that by changing the first argument from (HANDLE)0xFFFFFFFF to INVALID_HANDLE_VALUE, which is correct for a 64-bit program.
// create the file-mapping object
m_hMap = CreateFileMapping(
INVALID_HANDLE_VALUE, // use system paging file
NULL, // security
PAGE_READWRITE, // protection
0, MAX_SIZE+256, // size
szName); // name
I was then able to proceed past this point, but am now getting an error from FSUIPC - "IPC request contains bad data" later on in the FSUIPC_Open function, during the call to FSUIPC_Process. Specifically, the message sent to the FS window handle does not return success here -
// send the request (allow up to 9 tries)
while ((++i < 10) && !SendMessageTimeout(
m_hWnd, // FS6 window handle
m_msg, // our registered message id
m_atom, // wParam: name of file-mapping object
0, // lParam: offset of request into file-mapping obj
SMTO_BLOCK, // halt this thread until we get a response
2000, // time out interval
&dwError)) // return value
{ Sleep(100); // Allow for things to happen
}
The result contained in dwError is always 0 when the function returns. I did have to change the variable type for dwError from DWORD to DWORD_PTR to be compatible with 64 bit.
I have been stuck at this point, unable to communicate with FSUIPC. My goal is to integrate this as part of another application that has to be compiled in 64 bit, so it is essential that I am able to get this to work in a 64 bit program.