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 p开发者_C百科ost 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.
精彩评论