Solved

waveOutOpen () callback function problem

Posted on 1997-03-23
1
1,682 Views
Last Modified: 2008-03-17
I can't set the callback function for the waveOutOpen () windows API call. Here is my callback function:

procedure Callback (hWave: HWAVEOUT; uMsg: UINT; dwInstance:DWORD; dwParam1:DWORD; dwParam2: DWORD);
begin
  if (uMsg = MM_WOM_DONE) then
    Application.MessageBox ('done',done',mb_Ok);
end;


and here is my waveOutOpen () system call:

waveOutOpen (@AHWaveOut,
             wCount,
             @AWaveFormatEx,
             DWORD (@Callback),
             0,
             CALLBACK_FUNCTION);

This works fine without callback function. Why doesn't this work with this callback function ? The system crashes or tells me about an illegal read...

Help !
0
Comment
Question by:yragael
[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
1 Comment
 
LVL 3

Accepted Solution

by:
sperling earned 200 total points
ID: 1334932
procedure Callback (hWave: HWAVEOUT; uMsg: UINT;
                 dwInstance:DWORD; dwParam1:DWORD; dwParam2: DWORD);


Append a stdcall; to that line.

Regards,

Erik.
0

Featured Post

Technology Partners: 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

728 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