Solved

waveOutOpen () callback function problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

21 Experts available now in Live!

Get 1:1 Help Now