|
This bit sends cout to a console
<br />
if( !AllocConsole() )<br />
MessageBox(_T("AllocConsole failed."));<br />
<br />
m_hConsole = GetStdHandle(STD_OUTPUT_HANDLE);<br />
freopen("CONOUT$", "wt", stdout);<br />
cout = new stdiobuf(stdout);<br />
|
|
|
|
|
|
I need to delete the following recursively programatically. Any ideas??
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Enum\Root\LEGACY_NETBIOS\
Thanks,
Derek Smigelski
DerekS@mip.com
|
|
|
|
|
Are you really sure you want to do that?
|
|
|
|
|
Yes, not that exact registry path but a protected one yes. How can that be done programmatically?
Derek
|
|
|
|
|
I am not sure if this is really helpful but I guess "if" it's possible
your answer can be found with these functions:
RegGetKeySecurity , RegSetKeySecurity and RegDeleteKey .
Take a look at MSDN.
Sorry if I could not help much!
Good luck!
|
|
|
|
|
Newbie question ....
I want to execute ShellExecute(HWND hwnd,.....
so that I can run another executable while my program is still running.
The first parameter is a handle to the parent window.
Afraid I don't know what/where to use for the first parameter.
Any help would me appreciated!
|
|
|
|
|
Chances are passing NULL as the first parameter is OK for your purposes.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanks Joaquin,
Using NULL does compile!
I wrote:
int hrtn;
hrtn = (int)ShellExecute(NULL,"open","help.txt","","c:\\",0);
Hmmmm... It returns 42 which seems to indicate that it was successful, but nothing happens. Perhaps I missunderstand this call. I thought it would open an editor as a separate process.
BTW: running NT 4.0 SP5
Best regards,
Robert
|
|
|
|
|
You have passed "" as the lParameters parameter, when it should have been NULL .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquin,
Thanks again for response.
It still seems to not do anything.
Robert
|
|
|
|
|
Ummm... try ShellExecute(NULL,"open","c:\\help.txt",NULL,NULL,SW_SHOWNORMAL) (you know, I don't have my IDE handy to try these things out).
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Joaquín,
BINGO ! Yes it works. Pops right up as a separate process.
Thank-you again my friend,
Robert
|
|
|
|
|
Great
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I was wondering about CEditView.
I'm having problem to making selections within a CEditView and how to modify the text in it. I'm also wondering how to make a control for it and how to get/modify the text in it.
Thanks in advance ...
-- Kelthar :: icq9071676 :: http://uteliggare.net/southern/ --
|
|
|
|
|
CEditView::GetEditCtrl gives you access to the underlying CEdit control. On this control you can use the methods CEditView::SetSel , CWnd::GetWindowText and CWnd::SetWindowText .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Howdy,
I was wondering how I can have 2 or more new documents open by default each time my MDI application starts (instead of just 1).
Rob
|
|
|
|
|
In the InitInstance of your app, you can make a call on the document template that you registered to create a new empty document. Do this right at the end on of the InitInstance procedure:
pDocTemplate->OpenDocumentFile(NULL) ;
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|
|
Thanks! I figured it would be easy.
|
|
|
|
|
I think the serial number is in bios. how can i get it? is it hard because i'm just a beginner.
|
|
|
|
|
I am trying to develop an edit box that can take input and whne you push "return" it will automatically send the text as ... to the View. Now, I would like to be able to use somethinmg similar to Updatedata to do this but just for this EDIT box. But I want a simple way to do this so that I don't have to post a message specific for this (and every other edit box) and then in the View ready each via a call to GetDlgItem etc.
Any suggestions?
Thanks in advance.
|
|
|
|
|
Hello,
Does anybody know how to check System Memory from my application, and if it is below some limit, warn the user? To be more clear: I implement a HTTP server, using threads for handling clients requests. Probably my code is not so good, having some memory leaks (?), but, during a time, process couldn't allocate enough memory, and I want to be able to check this, and warning. What kind of memory I shall take care? Is possible to handle this situation?
Many thanks,
Mihai
|
|
|
|
|
surely it'd be better to fix the memory leaks? i for one wouldn't be all that impressed if i bought some software and it popped up a message saying "sorry, i lost a whole lot of your memory. your system is now running like a dog. please go buy more, so i can consume that too"
Sorry to dissapoint you all with my lack of a witty or poignant signature.
|
|
|
|
|
You are absolutely right, but let say, we will have no more memory leaks, and the server should receive an increased ammount of traffic: should't be nice to set the server to send an allert to webmaster, warning that he need a better machine?
|
|
|
|
|
Jon Hulatt wrote:
i for one wouldn't be all that impressed if i bought some software and it popped up a message saying "sorry, i lost a whole lot of your memory
We released an app which did just this, but it was a third party component we had to use which was doing all the leaking
Someone else can always make your own good work almost worthless.
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
|
|
|
|