Solved

MIDI Input API call

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now