by Dan Appleman - Desaware
Consider the problem:
Visual Basic 5 does allow you to retrieve the address of a function in a standard module. But it does not let you export it. Exported functions are an essential part of some tasks in Windows including:
How does one add support for exported functions to Visual Basic?
Well, you could perhaps reverse engineer the compiled Visual Basic DLL - but this presents a number of problems:
1. What happens if Visual Basic changes their internal structure?
2. How do you avoid compatibility problems in trying to make Visual Basic do something unsupported?
3. How do you guarantee that your changes are automatically added to the DLL each time it is built?
All of these problems make this approach unacceptable. One of the reasons that our tools have been so successful over the long run is that, while they are low level tools, they are NOT based on hacks and odd reverse engineering. They are based on documented low level features that are built into Windows and on taking advantage of the fundamental design of features such as OLE. If anything, we apply an extremely paranoid approach to our components. In five years we have only had one feature designed out from under us - and that occurred during the transition from 16 to 32 bits - the feature continues to work well in the 16 bit environment for which it was designed.
So, from our point of view, anything that modifies your compiled component is a high risk approach. The only exception that we’ve ever made to this was in our VB3 VersionStamper project which embedded version information in compiled VB3 applications - but note that those parts of the executable file format that relate to version information are clearly and publicly documented - so it really was a safe thing to do!
Desaware’s new SpyWorks 5 Dynamic Export Technology(TM) eliminates this problem by allowing you to export the functions immediately when your DLL loads. This is accomplished through an easy to use custom interface. The dwExport utility obtains a reference to your interface and calls functions which you implement. In these functions you define the names of the export functions, their ordinal values (every exported function can have an identifying number), and the standard module function that implements the export. Once the dwExport library has done it’s work, whomever is using your DLL will directly access the standard module functions that you have exported.
We think that this is one of the most exciting new technologies introduced in SpyWorks 5 - a true Desaware exclusive.