How do I create a function in my library for passing user callback function
- From: "Angus" <nospam@xxxxxxxxx>
- Date: Sun, 13 Apr 2008 18:39:16 +0100
Hello
I am writing a library which will write data to a user defined callback
function. The function the user of my library will supply is:
int (*callbackfunction)(const char*);
In my libary do I create a function where user passes this callback
function? How would I define the function?
I tried this
callbackfunction clientfunction;
void SpecifyCallbackfunction(cbFunction cbFn)
{
clientfunction = cbFn;
}
Then called like this:
clientfunction(sz); // sz is a C-string.
But program crashes with access violation when attempt to call
clientfunction
What am I doing wrong?
.
- Follow-Ups:
- Re: How do I create a function in my library for passing user callback function
- From: John Bode
- Re: How do I create a function in my library for passing user callback function
- From: Bill Reid
- Re: How do I create a function in my library for passing user callback function
- From: Ben Bacarisse
- Re: How do I create a function in my library for passing user callback function
- From: Ian Collins
- Re: How do I create a function in my library for passing user callback function
- Prev by Date: Re: Sliding window
- Next by Date: Re: [OT] Re: C Books and algorithm books
- Previous by thread: Problem with atoi and strlod
- Next by thread: Re: How do I create a function in my library for passing user callback function
- Index(es):
Relevant Pages
|