Creating an Extension
       by Jaspal Sohal  |  11 January 2006

Extensions are a fantastic new feature to Zinc v2.5 which provide unlimited expandability to Zinc v2.5 projectors. Developers can now create their own custom commands for {mdm}Script 2.0 based upon existing or custom DLL files.

The Zinc™ v2.5 Extension Creator provides an interface to your DLL which can then run internal functions via custom named {mdm}Script Commands. Extensions can be saved and shared with other developers to extend the {mdm}Script™ 2.0 API.

Note

In this Tutorial we shall create an extension from a function found in the Windows kernel32.dll - the functions available in the kernel32.dll are documented in the Win32 Programmer's Reference which is available at the MDM File Exchange.

For advanced users, the Zinc v2 Extension Creator SDK is also available at the MDM File Exchange.

We want to create a beeping sound using our animation, and we want to do it via a DLL accessed using Zinc. The kernel32.dll is a Shared Library which is available in all Windows Systems. This DLL allows access to the entire Windows API through a series of functions. To understand and use the available functions, we can check the Win32 Programmer's Reference.

The Win32 Programmer's Reference contains detailed usage guides on each function contained in the kernel32.dll. Click on Index and type the word "beep" in the search box at the top. The Chapter on the Beep Command should be highlighted as shown below:

[ the win32 programmer's reference window ]

With the Beep chapter selected, press the Display button. You will see some documentation outlining how to use the Beep function:

[ beep documentation ]

The Beep function within the kernel32.dll is a simple command which executes a System Beep Tone. The reference for the Beep function shows that this function has just 2 parameters:

  • Frequency (in hertz)
  • Duration (in milliseconds)

To create a custom {mdm}Script Command based upon this DLL Function, it is important that we know how many parameters are required so good DLL documentation is extremely important.

Onwards to the next page!


 

page 1 of 3


 




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.