Solved

MIDI Input API call

Posted on 1997-03-30
3
719 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

786 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