Click here to Skip to main content
15,877,384 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: string append with \ symbol Pin
Thilek23-Mar-09 23:40
Thilek23-Mar-09 23:40 
QuestionRe: string append with \ symbol Pin
Maxwell Chen23-Mar-09 23:51
Maxwell Chen23-Mar-09 23:51 
AnswerRe: string append with \ symbol Pin
Thilek23-Mar-09 23:58
Thilek23-Mar-09 23:58 
GeneralRe: string append with \ symbol Pin
David Crow24-Mar-09 2:51
David Crow24-Mar-09 2:51 
AnswerRe: string append with \ symbol Pin
KarstenK24-Mar-09 0:03
mveKarstenK24-Mar-09 0:03 
GeneralRe: string append with \ symbol Pin
Thilek24-Mar-09 0:34
Thilek24-Mar-09 0:34 
GeneralRe: string append with \ symbol Pin
Thilek24-Mar-09 3:14
Thilek24-Mar-09 3:14 
QuestionWriting a callback function? Pin
Maxwell Chen23-Mar-09 22:56
Maxwell Chen23-Mar-09 22:56 
I am trying to write a simple callback function for my own purpose, not to pass into Windows API as callback arguments. What I did below gets access violation. Where did I do wrong in the below code? Thanks.

typedef void (*fC)(int* p);

bool Test(int n, fC* p)
{
	int* pN = new int;
	*pN = 3;
	(*p)(pN);    // ---- access violation 0xc0000005.
	delete pN;

	return true;
}

void fc(int* p)
{
	*p;
}


void main()
{
	Test(3, (fC*)&fc);
}


  Maxwell Chen

AnswerRe: Writing a callback function? Pin
Eytukan23-Mar-09 23:06
Eytukan23-Mar-09 23:06 
GeneralRe: Writing a callback function? Pin
Maxwell Chen23-Mar-09 23:10
Maxwell Chen23-Mar-09 23:10 
GeneralRe: Writing a callback function? Pin
Eytukan23-Mar-09 23:17
Eytukan23-Mar-09 23:17 
AnswerRe: Writing a callback function? Pin
CPallini23-Mar-09 23:09
mveCPallini23-Mar-09 23:09 
GeneralRe: Writing a callback function? Pin
Maxwell Chen23-Mar-09 23:10
Maxwell Chen23-Mar-09 23:10 
AnswerRe: Writing a callback function? Pin
Iain Clarke, Warrior Programmer23-Mar-09 23:13
Iain Clarke, Warrior Programmer23-Mar-09 23:13 
GeneralRe: Writing a callback function? Pin
Maxwell Chen23-Mar-09 23:21
Maxwell Chen23-Mar-09 23:21 
GeneralRe: Writing a callback function? Pin
CPallini23-Mar-09 23:23
mveCPallini23-Mar-09 23:23 
QuestionEmail Notification for Outlook Express 6 Pin
ganesh.dp23-Mar-09 22:50
ganesh.dp23-Mar-09 22:50 
AnswerRe: Email Notification for Outlook Express 6 Pin
Iain Clarke, Warrior Programmer23-Mar-09 22:58
Iain Clarke, Warrior Programmer23-Mar-09 22:58 
GeneralRe: Email Notification for Outlook Express 6 Pin
ganesh.dp23-Mar-09 23:09
ganesh.dp23-Mar-09 23:09 
QuestionHow to get IP address using getadpetrinfo function using c/c++ Pin
optical12323-Mar-09 22:39
optical12323-Mar-09 22:39 
AnswerRe: How to get IP address using getadpetrinfo function using c/c++ Pin
CPallini23-Mar-09 23:00
mveCPallini23-Mar-09 23:00 
QuestionRe: How to get IP address using getadpetrinfo function using c/c++ Pin
David Crow24-Mar-09 2:57
David Crow24-Mar-09 2:57 
QuestionDevice Driver Pin
brucewayn23-Mar-09 22:08
brucewayn23-Mar-09 22:08 
AnswerRe: Device Driver Pin
CPallini23-Mar-09 22:36
mveCPallini23-Mar-09 22:36 
AnswerRe: Device Driver Pin
Maxwell Chen23-Mar-09 23:00
Maxwell Chen23-Mar-09 23:00 

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.