Click here to Skip to main content
15,917,506 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General\n in TRACE() Pin
Ravi Bhavnani27-Jul-02 8:58
professionalRavi Bhavnani27-Jul-02 8:58 
GeneralRe: index not within bounds? Help !! Pin
Bill S27-Jul-02 8:47
professionalBill S27-Jul-02 8:47 
GeneralRe: index not within bounds? Help !! Pin
nss28-Jul-02 6:54
nss28-Jul-02 6:54 
Generaltrying out your idea Pin
nss28-Jul-02 7:34
nss28-Jul-02 7:34 
GeneralRe: index not within bounds? Help !! Pin
Anonymous28-Jul-02 4:49
Anonymous28-Jul-02 4:49 
GeneralPort Numbers Pin
Waleed Eissa27-Jul-02 6:31
Waleed Eissa27-Jul-02 6:31 
GeneralRe: Port Numbers Pin
Anders Molin27-Jul-02 7:42
professionalAnders Molin27-Jul-02 7:42 
QuestionTimer Function Prototype ? Pin
hongheo7627-Jul-02 5:51
hongheo7627-Jul-02 5:51 
Hi,

I am writing a callback TimerProc function inside my class with the prototype:

// Inside the CClassTimerDlg.h

public:
void CALLBACK EXPORT CClassTimerDlg::TimerProc
(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent, // timer identification
DWORD dwTime // system time
);

// By the way, I copied this from the MSDN help

In my class implementation, I add a TimerProc as :

void CALLBACK EXPORT CClassTimerDlg::TimerProc
(
HWND hWnd, // handle of CWnd that called SetTimer
UINT nMsg, // WM_TIMER
UINT nIDEvent, // timer identification
DWORD dwTime // system time
)
{ Implementation of function TimerProc }


In one procedure handling a button inside the class, I put:

SetTimer(1,1000,TimerProc);


When I compile, I always receive the error message from the compiler for
the above line:

Error C2664: 'SetTimer' : cannot convert parameter 3
from 'void (struct HWND__ *,unsigned int,unsigned int,unsigned long)'
to 'void (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,unsigned long)'
None of the functions with this name in scope match the target type

How should I declare the TimerProc to correct this problem ?

Thanks a lot
AnswerRe: Timer Function Prototype ? Pin
Michael Dunn27-Jul-02 6:09
sitebuilderMichael Dunn27-Jul-02 6:09 
AnswerRe: Timer Function Prototype ? Pin
includeh1027-Jul-02 7:10
includeh1027-Jul-02 7:10 
AnswerRe: Timer Function Prototype ? Pin
Branislav28-Jul-02 5:21
Branislav28-Jul-02 5:21 
GeneralChanging a static picture Pin
Anonymous27-Jul-02 5:04
Anonymous27-Jul-02 5:04 
GeneralRe: Changing a static picture Pin
Michael Dunn27-Jul-02 6:26
sitebuilderMichael Dunn27-Jul-02 6:26 
GeneralRe: Changing a static picture Pin
Anonymous27-Jul-02 7:20
Anonymous27-Jul-02 7:20 
GeneralRe: Changing a static picture Pin
l a u r e n28-Jul-02 0:42
l a u r e n28-Jul-02 0:42 
GeneralRe: Changing a static picture Pin
Anonymous28-Jul-02 4:55
Anonymous28-Jul-02 4:55 
GeneralRe: Changing a static picture Pin
l a u r e n28-Jul-02 5:00
l a u r e n28-Jul-02 5:00 
GeneralRe: Changing a static picture Pin
Anonymous29-Jul-02 4:57
Anonymous29-Jul-02 4:57 
Generalthanks and need info ... Pin
includeh1027-Jul-02 4:38
includeh1027-Jul-02 4:38 
GeneralRe: thanks and need info ... Pin
perlmunger27-Jul-02 5:07
perlmunger27-Jul-02 5:07 
Generaldialog boxes and fonts Pin
Gary Kirkham27-Jul-02 2:21
Gary Kirkham27-Jul-02 2:21 
GeneralRe: dialog boxes and fonts Pin
Gary Kirkham27-Jul-02 2:27
Gary Kirkham27-Jul-02 2:27 
GeneralRe: dialog boxes and fonts Pin
Shog927-Jul-02 6:15
sitebuilderShog927-Jul-02 6:15 
GeneralRe: dialog boxes and fonts Pin
l a u r e n28-Jul-02 0:44
l a u r e n28-Jul-02 0:44 
GeneralRe: dialog boxes and fonts Pin
Michael Dunn27-Jul-02 6:37
sitebuilderMichael Dunn27-Jul-02 6:37 

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.