Solved

MIDI Input API call

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

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
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…

717 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