Return to the technote repository MS Visual


Magic has a special interface for extensions. You'll find in the userproc\ subfolder a sample.

Here is some settings to respect in order to make a Magic DLL in VC++ 5.

Structure alignment

The structure alignment to 1 (no alignment). For Visual C++, it is in the menu : "Projet\Settings...   (Alt F7)"

For better performance, you can separate all the Magic stuff (MAGIC_BIND function, FUNC_DSC table) in a file, and only compile this file to 1 byte alignment, the other files can be compiled to default (8 bytes) alignement.


The MAGIC_BIND function is the function that Magic uses to retrieve the functions in the DLL.

GET.DLL has a function that, like Magic, uses the MAGIC_BIND function to retrieve the list of function in a DLL.

You must add in your file.def (where file is your DLL name, and where file.def has been added to your project) this line :


To verify that the export is correct, use the "Quick View" option in the contextual menu in explorer. Dependency Walker does this job far better.