Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

hi !

can we use C++ code with all its features in BREW ?

i hve developed a code in C++ , nd at a point i m calling the
ISHELL_SetTimer functoin. the third parameter is not able to accept the C++ callback function . (gives a "typecast error"
i hav to write a C function from where i m calling the C++ callback , and hav to pass tht C function as the argument to ISHELL_SetTimer .

is ther any alernativ for that wher i can put in a C++ function ,as an argument to the ISHELL_SetTimer api .

You use pretty much all features of C++ with BREW. You can certainly specify C++ function for ISHELL_SetTimer call.
Post the code snippet showing your usage.
ruben

You use pretty much all features of C++ with BREW. You can certainly specify C++ function for ISHELL_SetTimer call.
Post the code snippet showing your usage.
ruben

Quote:Originally posted by Vishal Sinha
hi !
can we use C++ code with all its features in BREW ?
i hve developed a code in C++ , nd at a point i m calling the
ISHELL_SetTimer functoin. the third parameter is not able to accept the C++ callback function . (gives a "typecast error"
i hav to write a C function from where i m calling the C++ callback , and hav to pass tht C function as the argument to ISHELL_SetTimer .
is ther any alernativ for that wher i can put in a C++ function ,as an argument to the ISHELL_SetTimer api .
You probably need a c++ type typecast (with parameters). Check Stroustrup.

Quote:Originally posted by Vishal Sinha
hi !
can we use C++ code with all its features in BREW ?
i hve developed a code in C++ , nd at a point i m calling the
ISHELL_SetTimer functoin. the third parameter is not able to accept the C++ callback function . (gives a "typecast error"
i hav to write a C function from where i m calling the C++ callback , and hav to pass tht C function as the argument to ISHELL_SetTimer .
is ther any alernativ for that wher i can put in a C++ function ,as an argument to the ISHELL_SetTimer api .
You probably need a c++ type typecast (with parameters). Check Stroustrup.

If your "C++ function" is actually a non-static member function you'd need an adapter of some kind or simply to wrap it in a C function. See STL's mem_fun for example

If your "C++ function" is actually a non-static member function you'd need an adapter of some kind or simply to wrap it in a C function. See STL's mem_fun for example

Make your callback a static class method. If it's an instance call, then it needs a this pointer, which the callback isn't expecting.
--t

Make your callback a static class method. If it's an instance call, then it needs a this pointer, which the callback isn't expecting.
--t

I am not sure how many more time we have to answer this question!
Vishal, next time please try this link before you post...
http://brewforums.qualcomm.com/search.php

I am not sure how many more time we have to answer this question!
Vishal, next time please try this link before you post...
http://brewforums.qualcomm.com/search.php