ActiveX problem - won't update

I'm using Visual Studio 2005. I created an MFC ActiveX control. I made a couple of methods and compiled without error. I did tools->Choose Toolbox Items and brought in the OCX. I drag it onto my Visual Basic application and everything works. Problem is: if I change the MFC, re-compile and try to use the OCX in the VB, it is not updated, the code changes do not show up. I've tried deleting, registering, un-registering, re-registering, re-doing the Toolbox Items and on occasion I get lucky and the code changes will show up in the VB. But it's hit or miss and I spend more hours doing this crap than actual coding. What am I doing wrong and why would MS make a process that should be so intuitive actually such a mystery.

Thanks for your help
(As no one has answered yet, I'll ask the obvious...)

You don't mention unloading the ActiveX control. Are you remembeing to do so before you build?

I have not developed controls for VB, but I have coded Office and Visual Studio add-ins. I know that when I forget to unload them before building, the copy Office is using cannot be updated. Luckily it's just unchecking a checkbox to unload the dll, and then all is ok (unless I crash - then I need to restart the host app :-( )

Can you able to test your ActiveX control outside of VB?




Last edited on
Yes, the ActiveX Control Test Container shows all the recent changes to my code. How would I unload the control ? I have been doing the following prior to compiling: (un-checking check box) in Tools > Choose Toolbox Items > COM Components. Again, sometimes I get it to show the latest changes but it's random luck. It's an amazingly robust problem.

Thank you
Unchecking the checkbox (in VB's menu, yes?) should be enough to unload the control. Well, it is with Office!

Do you have logging in your control?

If not... I use a log file with my controls, in my case writing its file to C:\Temp\DebugLogs. That way I can check it's loading and unloading OK. Some kind of ref counting problem could prevent it unloading.

Failing that, I would seek out a forum where VB control developers hang out.
Last edited on
Topic archived. No new replies allowed.