Progressbar in VB.NET dll called from VB6
-
Monday, January 09, 2012 9:37 PM
I have a VB.NET (2008) project that's registered for COM Interop. When it's called from a VB6 project the ProgressBar appears empty and never updates. The process it's intended to show the progress of works perfectly fine but you can't see the progress change. In my test project in VB.NET the ProgressBar updates exactly as I expect. Any ideas why it's not working when called from VB6?
Thanks,
Jeremy
All Replies
-
Tuesday, January 10, 2012 9:57 AMJeremy, can you include a sample bit of code that demonstrates the problem?
-
Tuesday, January 10, 2012 5:06 PM
Brian,
Thanks for your response. Just to make sure there wasn't any code in my project that was causing my problem I created a new project in VB.NET that's simply a form containing a ProgressBar and nothing else. I set the project for COM Interop and then call this new project from my VB6 project and the ProgressBar does the same exact thing, nothing. I'm not sure if it matters but I have the Style of the ProgressBar set to Marquee and the MarqueeAnnimationSpeed set to 10.
Thanks,
Jeremy
-
Tuesday, January 10, 2012 7:37 PM
Jeremy,
The marquee style of the progress bar requires "visual styles" (aka "XP themes") to be enabled. This is a simple checkbox in the properties panel of a VB.NET app, but to enable it from VB6 you need to do it differently.
Brian
- Proposed As Answer by Brian Baker Wednesday, January 11, 2012 12:30 AM
- Marked As Answer by Shanks ZenMicrosoft Contingent Staff, Moderator Wednesday, January 11, 2012 3:39 AM
-
Tuesday, January 10, 2012 7:51 PM
Brian,
Awesome. That was it. I simply added the following to the entry point of my class and my ProgressBar does exactly what I'm expecting it to.
Thanks so much for your help. I'm glad I stopped spinning my wheels and finally posted my question.System.Windows.Forms.Application.EnableVisualStyles() System.Windows.Forms.Application.DoEvents()
Jeremy- Marked As Answer by Shanks ZenMicrosoft Contingent Staff, Moderator Friday, February 03, 2012 8:15 AM

