简体   繁体   中英

SQL Query notification from C++ ADO

I have two apps that need to receive notifications when data in a table changes. One .NET and the other C++ MFC. I decided to go with SQL Query Notifications.

I have built a proof of concept for the .NET app with SqlDependency class, but am struggling with the MFC version.

I found this http://msdn.microsoft.com/en-us/library/ms130764.aspx , but am not proficient enough with c++ to make sense of this.

Has anyone done this before? If so, could you please post some sample code or point me in the right direction?

Thanks in Advance

I can't see example code for C++ anywhere.

Rather than write and debug this (complex) event detection code twice, it would be possible (and preferable imo) to implement it in C#, and then expose the required function to your MFC app via COM interop. See here for a brief overview.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM