Oh, no, this is impossible. You can only P/Invoke a DLL, more exactly, using PE (Portable Executable) file you can link the functions exported.
I think you simply need to use
WINMM.DLL instead.
If the LIB file is not link library for any DLL or you don't know what DLL you should use,
this is a different story.
To find out, you can use I some binary dump utility such as
dumpbin.exe
,
http://msdn.microsoft.com/en-us/library/c1h23y6c(v=vs.71).aspx[
^] (to use this utility, it's best to start from "Visual Studio Command Prompt"). If this is a link library for some DLL, you can find out what DLL file to use. If it is not, you have nothing to P/Invoke.
You should first create some library which you could use in your C# project. Here is what you can do in this case:
Method #1. Create mixed mode project (managed + unmanaged) C++ with C++/CLI. You can link the library as unmanaged code, wrap calls to unmanaged code in C++/CLI class (classes). After that, you can use resulting library like a regular .NET Assembly and reference it in any C# project.
Method #2. Another opportunity is using P/Invoke. In this case, you create a regular unmanaged DLL using C++, link the library and export the function you need. Use P/Invoke with resulting DLL.
—SA