Results for "Author: selftaught"
This code is irrefutable proof that LenB(String) is 50% to 90% faster than testing for String = "". Most of you I'm sure already know this, but to my surprise someone tried to correct me saying that the latter was the correct way. So for all those who can benefit from this code, give it a try. Only 2.5 KB download.
This is an substantially updated version of my Basic Winzip Functionality Post. It's a complete wrapper around Infozip's open source compression (www.info-zip.org) I've seen several of these, but none as easy to use as this one. See the screenshot for the host of options available when zipping or unzipping files. Everything you need is included in the zip, just make sure to look at the readme file. Also, for those of you using vbAccelerator's cZip and cUnzip, you've got to check this out as an upgrade.
Now updated with some comments! This is a simple timer module with a standard implementation class. The module uses only a single timer resource, but it can fire events to a nearly unlimited number of subscribers. The worst precision that I have gotten is just under 2 hundredths of a second. The code uses the system time to determine when to fire, so there is no uptime limitation as with GetTickCount.
This code shows how you can make very functional and very pretty messageboxes and inputboxes, and it provides an implemented interface to allow all of the dialogs in your applications to be standardized for simple access. See the OPC directory for the two items used by this code that are 'Other people's code'. (Winsubhook and lvButtons.) You MUST register the Winsubhook type library before this group will run. This can be done with the references dialog of VB, using the browse button. Vote/Comments are unnecessary (Bug reports are very much appreciated), I just hope that someone finds this as useful as I have found much of the code on this site.
This code replaces XP find, and also provides functionality for creating compressed and/or encrypted composite files. It supports all conceivable search options, with the exception of searching inside of zip files. You may use my code(parts of this code are not mine) in any way you like, commercial or otherwise I don't care. I don't need votes/comments, but I would appreciate any and all bug reports or ideas on improving effeciency.
ASM callback procedures, compiler switches to expose only the functionality required, nice examples and more. Be sure to register the type library to run the project.
Api popupmenus, supporting custom colors/fonts Office XP style, images, highlight, init/uninitpopupmenu events, infrequently used, sidebars, per-item visibility, title-style headers for separators, and more.
Perhaps you've noticed that the VB Form engine does not support dynamic changing of the ui state. It gets the ui state when the form is first created and then never again. Obviously this defeats the whole purpose of it. For example, if the user opens your form using the mouse then the focus rectangles will not show on the command buttons or on other controls that conform to XP ui standards. This code a kludge that will show all ui states instead of only the state that was active when the form was created. Just call this sub in the initialize event of a form that is linked to CC 6 with a manifest.
Ever written a usercontrol that exposed a Font property? Then this code is for you. cFont.cls uses offers many features you won't get with the StdFont object. You can call the Browse method to show the Font dialog and the font properties will be set automatically if the user chooses a font. You can set the font to the ambient font or a system font and it will update itself provided that you call OnAmbientFontChanged from your usercontrol's AmbientChanged event or OnSettingChange in your WM_SETTINGCHANGED handler. All of the properties from the LOGFONT structure are exposed, including charset, escapement, etc. And I even included a property page that allows for multiple properties on multiple controls to be edited simeltaneously, all your controls have to do is implement the iSupportFontPropPage interface. Sound good? I had hoped so! Bug reports are much appreciated. Also, anyone who has downloaded my last submission, GDI management, should check out the new version I just uploaded with additional optimizations and much more in depth explanations and comments.
That horrible bug found by Lavolpe scared me into spending half the night going over this code with a fine-tooth comb. Minor optimizations and major commenting added. Anyone who downloaded the code before this update will probably want to scrap the old version and grab this one. Also check out the new screenshot. If that's not stress testing, I don't know what is! Inspired by Lavolpe's "GDI Font Management" submission, this code is a drop-in replacement for common gdi api calls. The benefits of using this code as opposed to the api calls directly are two-fold: 1. Identical fonts, brushes and pens are shared between all procedures who request them. A reference count is kept, and the objects are deleted when no longer in use. 2. Debugging is simple, simply change a few compiler constants and you will receive a debug message if any font, brush, pen, DC, or bitmap handles are leaked. This code is very fast, because it hashes the gdi objects and uses a linked list to store the necessary information. Actually it's a bit more complicated than that because the nodes in the list must be looked up by the gdi object when creating an object and by the handle when destroying it. So two linked lists are kept, but only one set of nodes. One is used to lookup by the gdi object and the other by handle.
This code uses Paul Caton's subclassing assembly code, but extends it to allow any number of objects to subclass the same hwnd. It is fast and memory effecient, and is easy to use. Included is a bare-bones example and an more thorough testing tool.
vbBase. So named because it is the foundation of all my best projects. It encapsulates all the details involved in subclasses, windows hooks, api timers, registered classes, vtable subclassing such as the iEnumVARIANT interface for for .. each enumeration and iOleInPlaceActiveObject, iPerPropertyBrowsing, and iOleControl for building powerful usercontrols.
Your GUI dream come true. 20 usercontrols to replace MS common controls 1, 2, and 3, the richedit and masked edit libraries, plus nice looking popup menus and a CC 6.0 friendly replacement for VB.Frame. Lots of goodies here. UPDATE: major refactoring done. vbBase.dll is history. now there is only the ocx and the test project. All api declares have been moved to a tlb, which allows for simply toggling overriding those declares using a compiler switch. This means that every singe allocated resource is tracked to ensure zero leakage. (See screen shot) Serious optimizations for size and speed. Eight bottleneck functions written in pure assembly. This is a veritable mountain of useful code, whether you want to take the time to figure out how it works for yourself or just remove the parts you need for your app. Recommended highlights: pcIntegerMap & pcStringMap for hash tables, mSubclass for asm subclassing (not Paul's, even better!), and mDebug for some techniques you could use to track all allocated resources in other projects.
Now updated with some comments! This is a simple timer module with a standard implementation class. The module uses only a single timer resource, but it can fire events to a nearly unlimited number of subscribers. The worst precision that I have gotten is just under 2 hundredths of a second. The code uses the system time to determine when to fire, so there is no uptime limitation as with GetTickCount.
This code shows how you can make very functional and very pretty messageboxes and inputboxes, and it provides an implemented interface to allow all of the dialogs in your applications to be standardized for simple access. See the OPC directory for the two items used by this code that are 'Other people's code'. (Winsubhook and lvButtons.) You MUST register the Winsubhook type library before this group will run. This can be done with the references dialog of VB, using the browse button. Vote/Comments are unnecessary (Bug reports are very much appreciated), I just hope that someone finds this as useful as I have found much of the code on this site.
Api popupmenus, supporting custom colors/fonts Office XP style, images, highlight, init/uninitpopupmenu events, infrequently used, sidebars, per-item visibility, title-style headers for separators, and more.
When this module is compiled to native code, you can use the ReplaceString, InString, InStringRev, StrReverse, TrimStr, RTrimStr, LTrimStr, StringReplicate, JoinString and SplitString functions to be many times faster and much more memory effecient than their VB counterparts. Many are more functional as well. The replacestring function supports delimiters and prefix/postfix exclusions. All of these functions are fully unicode compliant. The performance gain becomes greater with extremely long strings, where most of the functions take less than 2% of the time and half the memory that the same call would take with intrinsic functions. By the way, you can all stop telling me that xbeat.net/vbspeed has faster code. They did have faster code than my first version, but not any of the other ones. See for yourself, the test specifications are on their website. :)
This is an substantially updated version of my Basic Winzip Functionality Post. It's a complete wrapper around Infozip's open source compression (www.info-zip.org) I've seen several of these, but none as easy to use as this one. See the screenshot for the host of options available when zipping or unzipping files. Everything you need is included in the zip, just make sure to look at the readme file. Also, for those of you using vbAccelerator's cZip and cUnzip, you've got to check this out as an upgrade.
This code is irrefutable proof that LenB(String) is 50% to 90% faster than testing for String = "". Most of you I'm sure already know this, but to my surprise someone tried to correct me saying that the latter was the correct way. So for all those who can benefit from this code, give it a try. Only 2.5 KB download.
_Now_ it's as fast as it gets, folks. Yes, Faster than the code from xbeat.net. It beats the stuffing out of VB's intrinsic replace function even without the compiler optimizations. 5x-8x faster, even though it adds the ability to use delimiters and count the number of replacements. Uses a slightly modified string mapping technique from Chris_Lucas's post here a few years ago. Thanks to Rde for the SysAllocStringByteLen declare. That, plus some changes I made to calculate all the replacements before the return string is created are what account for the additional speed in the updated version of this post.