|
|
echeshari wrote: can someone gibe me source code
another member asking for source code. i am a newbie too and i am surprised to see the requests for the source code for getting their task done. in fact, i have seen it more often these days.
Look, you will never get an help if u ask for a source code. if u need any idea on anything, then ask for the advice and then implement it on your own. and if u still find anything difficult while implementing, then u can ask for more advice. else, no one will be writing the code for u.
vijay.
|
|
|
|
|
there's a link i like to post in such case... here lol...
|
|
|
|
|
So you are saying if I ask...
"HELP PLEASE!!! Hi. I'm a newbie and I need to write a server app that supports multiple
client connections and runs on both Mac and PC. The client apps need to use Direct3D to draw
the user interface because GDI is so slow. My boss says I need this done in 3 days. What are
"window messages"? Please provide code snippet that does this NOW!"
...that I won't get an answer?
Disclaimer: The above paragraph is ficticious. Any similarity to persons real or dead was purely
intentional.
|
|
|
|
|
I tried feeding this urgent request to Google and got nearly 58.000 answers. I guess at least one of them should be usable. The answer I would like most is: get your boss sacked for hiring you.
|
|
|
|
|
|
echeshari wrote: ...solving electronic circuits in computer
Please elaborate.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hie,
can I put __FILE__ and __LINE__ macros inside the class function which may not be inline. And
void function()
{
classobject::LogInfo(...);
}
Internally LogInfo should log file name and line number. Here I dont want user to pass those macros and also dont want to use any macros.
Is there any soln?
vikram S
|
|
|
|
|
vikrams wrote: can I put __FILE__ and __LINE__ macros inside the class function which may not be inline.
Why not!
vikrams wrote: Internally LogInfo should log file name and line number. Here I dont want user to pass those macros and also dont want to use any macros.
Is there any soln?
__FILE__ and __LINE__ macros should suffice. These macros can be used anywhere. I don't know if there is any other way.
|
|
|
|
|
Here the context is important. Those macros are used inside function of a class. Which will be replaced by appropriate values by preprocessor.So Everytie I will get my code line and file name only. But here req is to have client related info, right?
|
|
|
|
|
vikrams wrote: But here req is to have client related info, right?
What do you mean by client related information? __FILE__ and __LINE__ always gives current source file and line number.
What do mean by client here?
|
|
|
|
|
My dear friend,
Suppose I deaclared a class with is kind of function. The people who are going to use this class and function are my client. I want to provide this facility to them.But I dont want any hurdle those client like passing these __FILE__ and __LINE__ to my function to log information.I want it to do done implicitly. For example. I want to design a general purpose class for logging anything.
|
|
|
|
|
vikrams wrote: My dear friend,
:->
vikrams wrote: Suppose I deaclared a class with is kind of function. The people who are going to use this class and function are my client. I want to provide this facility to them.But I dont want any hurdle those client like passing these __FILE__ and __LINE__ to my function to log information.I want it to do done implicitly. For example. I want to design a general purpose class for logging anything.
Then maybe inline functions should help. But I am afraid as I haven't tried them myself.
But what's the purpose or reason for doing this. These macros are mainly for tracing purpose that's all.
|
|
|
|
|
macros: processed by preprosessor
After this
inline : processed by compiler
so this will not work as expected.
|
|
|
|
|
Nibu babu thomas wrote: Then maybe inline functions should help.
You forgot to put the joke icon.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: You forgot to put the joke icon.
|
|
|
|
|
You said inline functions are going help achieve what he wants. That was a joke.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: You said inline functions are going help achieve what he wants. That was a joke.
You didn't see the word maybe .
|
|
|
|
|
I am sorry. I could not stop posting. I need to tell you this.
inline has got absolutely NOTHING to do in this case.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: inline has got absolutely NOTHING to do in this case.
Yeah.
|
|
|
|
|
I guess I need some help and if possible solution. Any FUNDAS/BASIC discussion and finding the evidence of lacking it, can be taken offline. Right brahmma?
|
|
|
|
|
If you want to have this done implicitly there is no way to do it (that I know of) without macros.
Have a look in the VC++ run time library source code at how the new operator override (DEBUG_NEW) was implemented. The override provides memory leak tracking and uses the file and line number of the caller to do it which appears to be what you want.
|
|
|
|
|
|
|
Thank you very much vinsankar....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|