|
I thought this warranted a second reply- new is an operator, isn't it? It calls a function alright, just like you have to define a function when you're overloading the + operator for, say, a Complex class. But that doesn't mean + becomes a function, even w.r.t. class Complex
And yeah, my 5 for pointing it out. Thanks,
Vikram.
-----------------------------
My site due for a massive update
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Hi,
Both new and delete can be overloaded. Also, after overloading, you can still call the global new by ::new()
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Yes, I made a mistake . I don't even know what I confused it with. See my earlier post.
Thanx for pointing it out.
Vikram.
-----------------------------
My site due for a massive update
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
1st of all: I want to thank all of you for your interest...
2nd: How can I overload the new and delete functions?
Thank you all
The Server
|
|
|
|
|
1st of all: I want to thank all of you for your interest...
2nd: How can I overload the new and delete functions?
Thank you all
The Server
|
|
|
|
|
You an overload class specific new and delete as:
void * operator new (size_t size)
{
// do your thing
}
void operator delete (void * mem)
{
if (mem)
// do yout thing
}
You can also overload the global new and delete. Example, you can define something like:
void * operator new (size_t size, char * fileName);
void operator delete (void * p, char * fileName);
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Dear Pankaj and every one that reads this message
Thank you
...
Only one question that which the most disturbing
How do I call the Object's constructor(if is object?)
=-=-=-=--=-=-=-=-=
The Server
=-=-=-=--=-=-=-=-=
|
|
|
|
|
|
Hi
Im trying to figure out subject but I cant get it to work. I have no problem saving but when I want to load the data again I have to somehow know what type of object it is and then create it...how do I do that?
Tnx in advance!!!
|
|
|
|
|
The easiest way is to precede the class in the file with an enumerator that indicates what sort of object follows.
|
|
|
|
|
Why don't you put all your objects in a CObArray and use the CObArray::Serialize to read and write?
|
|
|
|
|
Hi friends,
Anybody have an idea how to get the details of the clients, workstation in a network ???
I thought it will be possible with NetBIOS. Is there any API for using that ??
Any suggestion regarding this will be very useful for my project.
Thanks & Regards
Satya
|
|
|
|
|
These should get you started:
WNetOpenEnum()<br />
WNetEnumResource()<br />
NetWkstaGetInfo()<br />
NetWkstaUserGetInfo()<br />
NetWkstaUserEnum()
|
|
|
|
|
hi david,
can i get some examples for these calls or any links for the examples.
regards
satya
|
|
|
|
|
|
I am looking for info on how to mimic the option bar found in winxp's explorer. It is also used in the CD burning software Alcohol 120%.
Sorry if I am not giving the correct name or describing it very well. I don't know what it is called. In explorer it has the options: system tasks, other places and details. They are collapsable. Well let me know.
Thanks,
Steve
|
|
|
|
|
|
Yes, but I don't use C# but thanks, I may can learn something from it
Steve
|
|
|
|
|
Oops, sorry, I didn't see it was written in C# when I looked at it...maybe I'll give a shot at porting it to MFC sometime.
Chris Richardson Terrain Software
|
|
|
|
|
|
|
Chris,
Thanks, I did happen to come across this article myself. Exactly what I was looking for.
Thanks for responding,
Steve
|
|
|
|
|
dear all,
i was just thinking about an developing an application which maintains a
counter (say the number of times it's been executed).
but i want the counter value to be maintaied within that application without using any external resources like registry, ini files, databases etc.
is possible for an application to keep track of such a counter.
regards,
|
|
|
|
|
No. If you do not want to save the value somewhere, there is absolutely no way to keep trace of your counter.
~RaGE();
|
|
|
|
|
This is just a guess, but you might could do it by modifying a known location within the EXE itself. Let's sayh you put two global variables in the program:
static LPCSTR lpszStringToSearchFor = "StringToSearchFor";
static DWORD dwRunCount = 0;
Now when the EXE is compiled, these two variables should be right next to each other. If you then searched for "StringToSearchFor," then the next 8 bytes would be the count. Modifying this value while the program is running might be a tad tricky. You might have to create a dummy program that launches the real program, waits for it to finish, then updates the count.
Another option that comes to mind is to update the count as a resource. Check out LoadResource(), LockResource(), BeginUpdateResource(), UpdateResource(), and EndUpdateResource().
|
|
|
|