On Tue, 25 Sep 2007, RAVI wrote:

> Date: Tue, 25 Sep 2007 07:15:13 -0000
> From: RAVI <[EMAIL PROTECTED]>
> Reply-To:  <[email protected]>
> To:  <[email protected]>
> Subject: [twincling] #define the main function
> 
> hello everybody,
> 
> 
>  I am writing a small application where my main function should be
> executed instead before users' main funciton.
> 
>  For that I have  #defined main function:
> 
>  #define main(a,b) main(int argc,char *argv[]){
>                                        my_function();
>                                             user_main();
>                                           }
>                                           user_main(a,b)
> 
> 
> 
>  Here my problem is that, How do I handle the case when the user don't
> have the arguments to main function?
>  like int main()............ 
> 
> If I #define for two possibilities the second one is over writing the
> first one.
> 
>      May I have some suggestions or ideas here?
> 
> -- Thanks in advance
> Ravi.T
> 

Hi Ravi:

You have asked a very interesting questions.

In fact a wrapper strategy is common with GUI toolkit code.

Please take a look at gtk_init() implementation in GTK+

It's a good starting point.

Please let me know your observations.


thanks
Saifi.

Reply via email to