المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Missed events when using vb6 Activex in C#



C# Programming
09-19-2009, 08:21 AM
Hello,
I'm programming a new c# application intended to control some hardware trough an ActiveX control. Given that I dont have the actual hardware, my client has provided me with a simulator OCX. The OCX is written in vb6 and it is supposed to read a status word from the registry and to fire an event whenever that word changes (that's accomplished by poling the registry, with a timer control inside the ocx). I've been also given a configurator program, which writes new values to the registry and a test program, which is a form application that consumes the ocx, both of them written in vb6 as well. At this point, everything works perfectly.
The problem arises when I want to use the OCX within a .net winforms application. I've simply referenced the control (visual studio created the wrappers), inserted it in a form and set up the corresponding event handler, which writes the status word to a label control. I've noticed that, very often, the changes in the registry are missed by the control and the corresponding event is not fired. I've confirmed this by using sysinternals regmon to watch the new values being actually written to the registry, and there seem not to be any problem in that matter.
Did anybody have a similar problem?
I would really appreciate any help.
Thanks in advance,
Bernabé