|
Probably you can't. Furthermore, if you override delete then you've also to override new , see, for instance [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hmm.
It strikes me that you have reached a language boundary.
Under the cpp model, you can only override functions as follows:;
Member Functions in a Derrived Class with the same Param list,
Member Functions in your original + Derrived Class class with different Param Lists.
Global Functions with different parameter lists.
'delete' is not a global function, but a keyword like 'if' and 'for'
you can override it with your own implementation, but, if you do so, you replace it. That is only possible because it is a keyword. If it were a global function, you would not be able to re-define it at all. (you'd get all types of linker errors)
My advice is: Re-Design the Code.
regards,
Bram van Kampen
|
|
|
|
|
Dear friends
please tell the answer
how many files can be opened in windows OS at a Time ?
by
paul
|
|
|
|
|
there is no such a limitation AFAIK.
IIRC, there is one at Process Level, but I don't know its limit.
I believe you can find it as a #define in some header file (not sure however)
|
|
|
|
|
I am asked by Micorsoft Technical Interview
|
|
|
|
|
Well, then they're interviewing you, not us..
Or you could argue that this is testing your ability to research things.
My answer would be: "If you need to know, your design is wrong".
Iain.
|
|
|
|
|
Does this [^] help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
paul crescent wrote: how many files can be opened in windows OS at a Time ?
The limit referred to probably is the lowio level of the C Runtime Library which is 2,048 simultaneously opened. Read more here[^].
There are other limitations such as on stdio level, which is 512 by default but can be increased with a call to <a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx">_setmaxstdio()</a>[<a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx" target="_blank" title="New Window">^</a>] to a maximum of 2,048.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Well,
There are no more hard and fast limits, unlike DOS, where you had to specify how many. The answer is, that it depends on resources, and what's consumed with each file. It also depends on resources required by the OS.
One answer would be, a Multitude more under XP than under Vista, on the same hardware. The other answer is Depends on the response time reqired. If you measure response time of the computer in weeks, the number would be determined by your disk size
Bram van Kampen
|
|
|
|
|
Hi All
I am try to edit regedit values in VISTA OS.It is working when UAC off.But when UAC is on then it's not working.Code is here
HKEY hKey;
DWORD dwDisp = 0;
LPDWORD lpdwDisp = &dwDisp;
CString l_strExampleKey = "SYSTEM\\CurrentControlSet\\Services\\USBSTOR";
CString l_strDWordSample = "Start";
DWORD dwVal = 4;
LONG iSuccess = RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Services\\USBSTOR", 0L, KEY_READ , &hKey);
if(iSuccess == ERROR_SUCCESS)
{
RegCreateKeyEx( HKEY_LOCAL_MACHINE, l_strExampleKey, 0L,NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey,lpdwDisp);
RegSetValueEx (hKey, l_strDWordSample, 0L, REG_DWORD,(CONST BYTE*) &dwVal, sizeof(DWORD));
}
RegCloseKey(hKey);
Plz help me where i am wrong..
Thanks in advance
|
|
|
|
|
See here[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
I'm wired with this two days now.
In a chr* buffer I got a int in ASCII.
I want to convert into UNICODE and attach a stringstream, which is a UNICODE stream.
How can I do it.
Help really appreciate.
Thanks a lot,
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote:
I want to convert into UNICODE...
Check out wchar_t .
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Check out [^] and [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
i think, you need to convert the number to string (like "123" for example) first using wsprintf, or any similar function like that. If not, if the value is zero, then it may be taken as the end of string (depends upon how you use the string stream).
|
|
|
|
|
Can you explain it with a simple example, please.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Here what I have done so far.
<br />
<br />
int temp = InMsg[0];
<br />
stringstream str(ios::in|ios::out|ios::binary);<br />
if(CopyTo(str) == 0)
{<br />
wchar_t* results = new wchar_t[1];<br />
swprintf(results, L"%d", temp);<br />
<br />
InMsg.Attach(results, 0);
}<br />
My attach function like this.
<br />
bool CRfMessage::Attach(istream& str, const UINT offset)<br />
{<br />
size_t buffer_size;<br />
<br />
if(str.bad()) <br />
return false;<br />
<br />
str.seekg(0,ios_base::end);<br />
<br />
buffer_size = str.tellg();<br />
<br />
char* payload = (char*)AdjustDataSize((UINT)buffer_size+offset);<br />
<br />
str.seekg(0,ios_base::beg).read(payload+offset,buffer_size);<br />
<br />
return true;<br />
}<br />
I appreciate your help all the time...
CodingLover
|
|
|
|
|
here's a simple way to do it without needing any libraries. it's not protected from overflow though, so be warned!
int main(int argc, char* argv[])
{
char ascii[100] = "example", *ascii_p = ascii;
wchar_t unicode[100], *unicode_p = unicode;
while (*unicode_p++ = *ascii_p++);
std::cout << ascii << std::endl;
std::wcout << unicode << std::endl;
return 0;
}
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hello to all,
there are some standard methods (like MAPI) of MFC through which we can send emails by programming.In these methods when we will click on "Send" option of menu item, firstly our email id will be connected to outlook express and then through it mail will be sent. But I am doing a project in which I want to do this without getting connected to outlook express GUI because I have created my own dialog box which contains some edit boxes,one button "Attach",another button "Send". Edit boxes are used to write email adresses to whom u want to send mail,to display attached file names and to write the actual message you want to send.After clicking on "Attach" button selected files should get attached to the mail and after clicking on "Send" button, mail should be sent along with the typed message and attached files,to the email addresses we typed in an edit box.In this I dont want to use outlook express.Can anyone tell me how to do this? It is really urgent so plz can anyone help me out?
Thanks and Regards,
Anay
|
|
|
|
|
AnayKulkarni wrote: Can anyone tell me how to do this?
By reading the mail-related articles here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Which C++ compiler is the best ? VC6, VC7, VC8?
Thanks
modified 7-Mar-17 16:30pm.
|
|
|
|
|
|
Usually the upper is the number, the better is the compiler.
The above rule is wrong when applied to their operative systems.
BTW the compiler name is CL .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I've read that VC6 generates the fastest executables. My impression is consistent with that. I like VC6's GUI better too. I seem to remember reading a claim that it wouldn't work on Vista, but I'm not sure about that.
|
|
|
|
|
VC6 has worked fine for me on Vista for years, you just have to run it elevated. I have a post on my CP blog about how to install it.
|
|
|
|