Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Does Driver.Start() in CWDAQ.OCX clear msgs from the Queue?

I am hosting the CWDAO.OCX ActiveX control in my (C++) application, and communicating to it through VBA. I am also communicating to other devices through an OPC (COM) interface, and occasionally COM messages get lost (specifically, the WM_USER message gets removed from the message queue without getting processed).

It looks like Driver.Start() is removing the messages from the queue. If I add a DoEvents statement to the VBA before starting the driver the frequency of the problem drops significantly.

Does this sound familiar to anyone?

Thanks.

Brent E. Meranda
Software Project Lead
Parker Hannifin Corporation
Electromechanical Automation - CTC
50 W. TechneCenter Drive
Milford, Ohio 45150
0 Kudos
Message 1 of 4
(6,674 Views)
Hello,

You have to check which Windows Messages your ADE (C++) uses. Some programs use a WM_user+K, where WM_user is a constant that can be defined for instance on addresses starting at 0x0400 through 0x7FFF. In this case, your program uses adresses from 0x0400 to 0x(0400+K). e.g. is K is 10, your program uses address 0x0400 to 0x040A.

Hope this helps,

LA
0 Kudos
Message 2 of 4
(6,663 Views)
Hi LA,

Thanks for taking the time to respond to my question.

It’s actual COM that is posting the message in order to marshal data across an IAdviseSink interface. COM uses WM_USER+0 (which I referred to simply as WM_USER) as the message, with WPARAM set to 0xbabe.

I am able to spy on the NationalInstruments message window, and it uses WM_USER+0 through WM_USER+12. However, it posts the messages to its own window and usually does not interfere with the COM messages. I suspect that somewhere during an acquisition start it is either clearing the entire message queue, or stripping the WM_USER messages from the queue without first checking the window handle of the messages.

This causes the OPC server I’m using to hang because it is waiting on my application to respond to a COM callback that it never receives.

Brent
0 Kudos
Message 3 of 4
(6,656 Views)
Hello,

We would like you to send us an email to support so that we can understand your situation better. In the body of your email, specify to direct the email to Luis, and we will work from there. Also if you can give us more information about the problem (screenshots, spy captures, etc.) that would be great.

Thanks,

LA
0 Kudos
Message 4 of 4
(6,631 Views)