Reveal internal DLL functions

While the Windows API functions are fairly well documented, you
may come across other DLL files that remain a mystery. For
example, suppose you want to incorporate the MIDAS digital audio
player into your application. The help files that come with this
free DLL list all the important external function names. However,
because the DLL doesn't support Visual Basic, you must hook into
the DLL with API declarations. The internal names supported in
this library aren't in the help files.

To unravel this mystery, you can use the Dependency Walker, a
handy utility that comes with Visual Studio (appears as Depends
on the Windows program menu). Simply point the utility to the
DLL in question, and it will list all the internal file names
that you'll need to refer to in your API declarations. For
example, in the MIDAS DLL, you use a function called
MIDASplayModule to play a sound module. However, the internal
name for the function is _MIDASplayModule@8. As a result, you
must declare the function in Visual Basic like so

Declare Function MIDASplayModule Lib "midas11.dll" Alias _
     "_MIDASplayModule@8" (ByVal module As Long, ByVal loopSong _
     As Boolean) As Long


Using the Dependency Walker on MIDAS, you could quickly and
easily determine the library's internal function names.

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Anyone who considers arithmetic methods of producing random digits is, of course, in a state of sin.” - John von Neumann