genwrapper source code

Last modified: 08 Jul 2003

download

Download GenWrapper Source Code in Zip Format

about

The following is taken from the ReadMe.txt file included in the source code download.

The source code for GenWrapper is distributed here free of charge and may be used for reference purposes. No other party may recompile GenWrapper and distribute it publicly in binary form without express permission of the author. No other party may take credit for the source code. If any part of the source code is copied for public display, the author must be referenced.

Notes:

This is the original source code to GenWrapper, as written to compile under Microsoft Visual C++ 5.0.

Care must be taken when reusing this source code, as GUIDs must be changed to new unique values so there is no conflict with the original GenWrapper product. Ideally, this source code is intended for reference purposes only.

The project will successfully upgrade when opened in later versions of Microsoft Visual C++ (6.0 and .NET have been tested). There is one compilation error when it is built again these later Windows header files:

main.cpp, line 106, change to: hInst = (HINSTANCE)hModule;

(The error is due to HANDLE being made 64-bit compatible in the later versions - the original source assumed 32-bit values.)

The files GenWrapper_i.c and interfaces.h are not automatically regenerated from GenWrapper.odl (although they were originally generated this way). To turn on this autoregeneration inside Visual Studio:

The original GenWrapper.dll was very small (~7KB). This was achieved by setting the binary file alignment to 1KB (compared to the default segment size of 4KB). This may not be possible in later versions of Visual C++, and probably is not advisable or worthwhile anyway.

After building the project, the output directory contains GenWrapper.dll (the file which gets renamed and used as the proxy between WinAmp and a Visual Basic DLL) and GenWrapper.tlb (the type library which can be referenced from Visual Basic).

GenWrapper stores DLL registration dates in the registry. This was probably a bad idea, because GenWrapper attempts to write to HKEY_LOCAL_MACHINE, which normal users cannot write to under NT/2000/XP+. See reg.cpp for how this was done (but I advise against using this approach for anything).

Any comments or questions, please email me: col_rjl@hotmail.com.

Enjoy.