Solved

waveOutOpen () callback function problem

Posted on 1997-03-23
1
1,644 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
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

Industry Leaders: 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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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