Re: using a function pointer in another function

Tech-Archive recommends: Fix windows errors by optimizing your registry



> Here's what I have :
>
> U32 (*pf) (HANDLE, LPVOID); //declaring the function pointer
>
> U32 __stdcall F (HANDLE a, LPVOID b) //defining F
> {
> ......
>
> return 0;
> }


> pf = F; //assigning the address of F to pf

I believe last expression is in the some function's body, otherwise it's
invalid.
If you want to declare and initialize static variable you have to write

U32 (__stdcall *pf) (HANDLE, LPVOID) = F;

or

typedef U32 (__stdcall * func_pointer) (HANDLE, LPVOID);
func_pointer pf = F;
--
Vladimir Nesterovsky
e-mail: vladimir@xxxxxxxxxxxxxxxxxxxx
home: http://www.nesterovsky-bros.com


.



Relevant Pages

  • Re: Email Address Regex
    ... I mean that it might declare some addresses invalid although they ... David Black in the other threadthat this regex is indeed compliant ... Prev by Date: ...
    (comp.lang.ruby)
  • Re: Question Regarding Select Into
    ... It gives an invalid number error. ... number field or it can have any other datatype field as its argument?. ... Prev by Date: ...
    (comp.databases.oracle.tools)
  • Re: using a function pointer in another function
    ... "Vladimir Nesterovsky" wrote: ... > invalid. ... > If you want to declare and initialize static variable you have to write ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Question Regarding Select Into
    ... ORA-01722: invalid number ... please clarify. ... Prev by Date: ...
    (comp.databases.oracle.tools)
  • Re: XML Explicit query results to xp_cmdshell
    ... you might get an invalid token. ... my trigger and code are below. ... > DECLARE @bind_token varchar ... > exec master..xp_cmdshell @cmd ...
    (microsoft.public.sqlserver.xml)