The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Control redrawing technique for VB6 apps

We all know that there are tons of VB6 applications that work fine, even under Vista
(and probably the next Ms OS).

Sometimes there is no need to hurry and rewrite these *working* VB6 apps for C# or VB.NET.

BUT giving a fresh look to old applications isn't a bad idea.
Everybody agrees?

Well, there is a code example, that intensively uses subclassing to redraw controls on the fly, for VB6 applications.
It only takes 1 line of code, per form.
Please have a look at it at:
 http://www.1vbstreet.com/vb/scripts/ShowCode.asp?txtCodeId=51400&lngWId=1         
 
Well, I was just wondering if there is a commercial ActiveX control for doing this.
Also, what do you think about the overhead of doing this?
Maybe it isn't as bad as it seems….

Thanks a lot,
Jag

Monday, November 12, 2007
 
 
Jag, another way to do this is just to include a manifest file and save it in the same folder as your VB6 EXE program. If your PC is running Windows XP, your old VB screen controls should be updated to use the Win XP controls. Do a Google Search on manifest files.
Ezani Send private email
Monday, November 12, 2007
 
 
Hey Ezani,

Thanks for your reply, I had already tried that, but since I have some other controls that uses sublassing and other techniques I get strange results.

(When using the .exe.manifest, option/radio buttons get black background when inside a frame, that's no prob since its solved by placing them inside a picturebox control. But I have custom controls that look really strange whe using the manifest file.)


With the WinXPC engine I posted you can choose the controls that'll be redrawn.
BUT redrawing does not work on certain conditions, and the project is incomplete.


That's why I posted, to see if there is any commercial application to do so, or if you can specify what controls to apply the style to........

Well.. thanks a lot anyway Ezani.

Jag
Jag V. Send private email
Tuesday, November 13, 2007
 
 
No problems, Jag!
Ezani Send private email
Tuesday, November 13, 2007
 
 
Jag, if you use this, go through the comments posted. There are several memory leaks due to unreleased handles.

I came across this control a while back and decided against using it. If the author isn't going to fix the memory leaks and other issues, it isn't worth trusting in production code.
Nicholas Hebb Send private email
Wednesday, November 14, 2007
 
 
Nicholas Hebb,

You are right about the memory leaks.

I decided to use the manifest file, and work around the problems associated with it.
I just had to subclass the graphical style command buttons.

Thanks a lot for your comments,
Jag
Jag V. Send private email
Monday, December 10, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz