Click here to Skip to main content
15,885,931 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPrecompiled Headers Pin
JWood15-Feb-05 12:38
JWood15-Feb-05 12:38 
GeneralRe: Precompiled Headers Pin
Selvam R15-Feb-05 22:27
professionalSelvam R15-Feb-05 22:27 
GeneralRe: Precompiled Headers Pin
ionzarate16-Feb-05 2:56
ionzarate16-Feb-05 2:56 
QuestionWindow's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 12:22
InflatableGarfield15-Feb-05 12:22 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
Ravi Bhavnani15-Feb-05 12:34
professionalRavi Bhavnani15-Feb-05 12:34 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
ThatsAlok15-Feb-05 18:09
ThatsAlok15-Feb-05 18:09 
AnswerRe: Window's Client RECT in Screen Coordinates? Pin
InflatableGarfield15-Feb-05 22:09
InflatableGarfield15-Feb-05 22:09 
GeneralwaveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 11:39
anaknakal15-Feb-05 11:39 
Hi everyone,

I have some compilation problems related in using waveInOpen and waveInProc callback function.

Following is snippets of my code:

// function that calls in the waveInOpen
bool WaveIn::Start()
{
// open the wave in device
if(waveInOpen(&hwi, WAVE_MAPPER, &wformat, (DWORD)waveInProc, 0, CALLBACK_FUNCTION) != MMSYSERR_NOERROR) return false;
....
}

// callback function waveInProc

void CALLBACK WaveIn::waveInProc(HWAVEOUT hWaveOut, UINT uMsg, DWORD dwInstance,
DWORD dwParam1, DWORD dwParam2)
{
switch(uMsg)
{
case WIM_DATA:
// ... uses member variables
}
}

The compilation error that I encounter is that waveInOpen parameter 4 (which is the callback function) cannot be casted. I have tried to cast the waveInProc parameter, but to no avail. It compiles alright if I make waveInProc static. However, if I make waveInProc static, it prevents me from modifying the member variables.

Thank you and your solutions are totally appreciated.



Thank you so much and all your comments are appreciated.
GeneralRe: waveInOpen and waveInProc problem. Pin
vinnzy15-Feb-05 18:53
vinnzy15-Feb-05 18:53 
GeneralRe: waveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 20:46
anaknakal15-Feb-05 20:46 
GeneralRe: waveInOpen and waveInProc problem. Pin
Sapto Priyono15-Feb-05 20:09
Sapto Priyono15-Feb-05 20:09 
GeneralRe: waveInOpen and waveInProc problem. Pin
anaknakal15-Feb-05 20:52
anaknakal15-Feb-05 20:52 
Questionfor ( ; i < 5; i++) ? Pin
Link260015-Feb-05 11:33
Link260015-Feb-05 11:33 
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
Maximilien15-Feb-05 12:28
Maximilien15-Feb-05 12:28 
GeneralRe: for ( ; i < 5; i++) ? Pin
Link260015-Feb-05 17:29
Link260015-Feb-05 17:29 
GeneralRe: for ( ; i &lt; 5; i++) ? Pin
Antony M Kancidrowski15-Feb-05 23:09
Antony M Kancidrowski15-Feb-05 23:09 
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
Ryan Binns15-Feb-05 17:34
Ryan Binns15-Feb-05 17:34 
AnswerRe: for ( ; i &lt; 5; i++) ? Pin
namaskaaram15-Feb-05 22:37
namaskaaram15-Feb-05 22:37 
QuestionWhat is the max length of tree branche? Pin
bilas15-Feb-05 7:52
bilas15-Feb-05 7:52 
AnswerRe: What is the max length of tree branche? Pin
rocky_pulley15-Feb-05 9:03
rocky_pulley15-Feb-05 9:03 
GeneralRe: What is the max length of tree branche? Pin
bilas15-Feb-05 11:03
bilas15-Feb-05 11:03 
Generalcheck if PC connects to the internet Pin
includeh1015-Feb-05 5:49
includeh1015-Feb-05 5:49 
GeneralRe: check if PC connects to the internet Pin
Ravi Bhavnani15-Feb-05 8:58
professionalRavi Bhavnani15-Feb-05 8:58 
GeneralRe: check if PC connects to the internet Pin
David Crow15-Feb-05 10:57
David Crow15-Feb-05 10:57 
GeneralRe: check if PC connects to the internet Pin
includeh1015-Feb-05 22:48
includeh1015-Feb-05 22:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.