I have a CIN that uses a Mutext file to pass booleans between LV 6.1 and a C++ executable. I know that the data is going into the Mutext file from the CIN but isn't being recognized by the executable as being there.
I thought it might be do to incorrect value formatting (ie: int, float, bool, etc.) but I tried several variations and none worked.
Following is the code for the CIN:
typedef struct{
LVBoolean CalibrateMe; /* bool in C++ */
LVBoolean UnCalibrateMe; /* bool in C++ */
LVBoolean UseArbitraryPoints; /* bool in C++ */
} HandshakingData;
CIN MgErr CINRun(HandshakindData *HandshakingRecord,
uInt32 *m_hMutex, uInt32 *handshakeptr)
{ DWORD dwWaitResult
;
dwWaitResult = WaitForSingleObject(
(HANDLE)*m_hMutex,INFINITE);
switch(dwWaitResult)
{ case WAIT_OBJECT_0:
__try
{ HandshakingRecord->CalibrateMe = true;
HandshakingRecord->UnCalibrateMe = false;
HandshakingRecord->UseArbitraryPoints =
false;
memcpy((void *)(*handshakeptr),
(void *)HandshakingRecord,
sizeof(HandshakingData));
ReleaseMutex((HANDLE)*m_hMutex);
}
__finally
{ if(!ReleaseMutex((HANDLE)*m_hMutex))
{ /* error code here */
}
}
default:
{ }
}
return noErr;
}
To my knowledge there isn't any error in the code above, yet the executable isn't acknowleding the updated information written via memcpy. The size of the structs match (ie: 3 bytes
each).
Anything would be helpful.
KH @->---
The test of a first-rate intelligence is the ability to hold two opposed ideas in mind at the same time and still retain the ability to function. F. Scott Fitzgerald