Solved

MIDI Input API call

Posted on 1997-03-30
3
726 Views
Last Modified: 2008-02-26
I'm using Visual Basic 5.0 (Pro) and want to be able to use the MIDI input API call (specifically the midiInOpen function).

Can anyone help me with this? I've got MIDI Output working fine (exceptionally well, in fact), and I know I can get the Input working as VB5 supports DLL callbacks, but I don't really know where to start!

Thanks!
A.G.
0
Comment
Question by:Afterglow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
YiannisVolos earned 75 total points
ID: 1424849
Hello, I think I have an answer to your question...

Insert a module and then paste the following in the module. This will load the function MidiInOpen. Put this code on one line.
--MODULE--------------------------------------------------------------
Declare Function midiInOpen Lib "MMSYSTEM" (lphMidiIn As Integer, ByVal udeviceid As Integer, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Integer

Public Const MCI_MODE_OPEN = (MCI_STRING_OFFSET + 18)

Public Const MCI_MODE_PAUSE = (MCI_STRING_OFFSET + 17)

Public Const MCI_MODE_PLAY = (MCI_STRING_OFFSET + 14)

Public Const MCI_MODE_RECORD = (MCI_STRING_OFFSET + 15)

Public Const MCI_MODE_SEEK = (MCI_STRING_OFFSET + 16)

Public Const MCI_MODE_STOP = (MCI_STRING_OFFSET + 13)

Public Const MCI_MODE_NOT_READY = (MCI_STRING_OFFSET + 12)

Public Const MCI_LOAD_FILE = &H100&

This will help you start ...
0
 

Author Comment

by:Afterglow
ID: 1424850
Hi,

Sorry - I'd already got that far, and could call the procedure successfully (returned a non-error value) but I haven't been successful in receiving the callbacks from it, even though I used the AddressOf [function] operator when calling it.

Have you/anyone managed to do this with VB5 yet?

Thanks!
A.G.
0
 
LVL 1

Expert Comment

by:eversoslightly
ID: 2677881
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question