09/23/2022
Our application is getting a MessageBeep while inside calls to IOPCSyncIO::Read. This happens while trying to restore the app from icon by mouse click. Debugger shows that MessageBeep occurs outside of our code (i.e. inside IOPCSyncIO or related code).
As a test/proof, I forced the message pump to be flushed before messages can be “stolen” by OPC. With the following code hacked in, I no longer get MessageBeeps and I’m able to restore app from icon:
MSG msg;
while (PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
hRet = pSyncIO->Read(OPC_DS_DEVICE, dwItemCount, phItems, &pItemStates, &pErrors);
Flushing the message pump shouldn’t be necessary. Has anyone else encountered this and is there a solution?
I’m not sure which version of OPC is in use for us (we’re quite an old product). From reading the forums it seems to be the Classic version of OPC client and a look in C:\Program Files (x86)\OPC Foundation\NuGetPackages shows version 2.1.107 (if this is relevant).
Any help would be appreciated.
Sam
1 Guest(s)