|
how to access group policy through wmi using mfc. i have to add script to be run at shutdown time. how to query this to group policy in wmi
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
We have recently been tasked with modifying all of our .cpp, .h, and .c files to include a specialized header at the top of the files.
Is anyone familiar with any application that apply this header programmatically and save us a lot of manual work?
|
|
|
|
|
I don't know of any.
But it shouldn't take more than a couple of hours to write one of your own.
I would make a dialog based app that would let me select a file that contained the header I wanted and then let me browse for a folder where my source files were located.
Making it more fancy, e.g. a tree view with checkboxes for all files, would probably take two more hours to make it work properly.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Maybe you can include it in your stdafx file if you use one ?
|
|
|
|
|
I have done this with a macro in the past - both in VC6 and in VS2005. It means you have to open each file in the editor and select the macro, but that's better then hand-typing the header every time.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
After some digging, I did decide to write my own application in C# that will take a header file and apply it to the top of every source code file.
|
|
|
|
|
You could do that in a few lines of Perl
|
|
|
|
|
Dear All;
I have noticed that once I close a dialog box from the (x) icon -top most right corner-, the dialog is not destroyed. By the way, this dialog is a child of a another main window.
How do i destroy a child window only whenever the user tries to close it from x icon?
Is it enough to add OnClose() event handler to the dialog box? and what should it contain? I have tried the code below but this resulted in the closure of the whole application which i dont want:
<br />
void ChildDlg::OnClose()<br />
{<br />
PostQuitMessage(WM_QUIT);<br />
CDialog::OnClose();<br />
}<br />
Thank you
-- modified at 10:40 Friday 13th April, 2007
llp00na
|
|
|
|
|
Is this a modal or modeless dialog box? Modeless dialogs require some additional thought and consideration.
|
|
|
|
|
I am using a modeless dialog box. Would you also please explain how does it differ when using modal dialog? Thank you
llp00na
|
|
|
|
|
A modal dialog is invoked with DoModal() and it does not return until the dialog is dismissed effectively preventing interaction with the owner.
A modeless is created with Create() and returns immediately leaving the owner AND the dialog open for interaction.
Referencing Jeff Prosise's book I get...
Modeless:
1) Dismiss the dialog using DestroyWindow and not EndDialog()
2) Do not allow CDialog::OnOK or CDialog::OnCancel because both call EndDialog()
3) Instantiated with "new"
4) Override CDialog::PostNCDestroy in the derived dialog class and execute "delete this"
Modal:
1) Dismiss the dialog with EndDialog(). Refer to Mr. Sivakumar's views on modality[^] for additonal info
2) Instantiated on the stack
|
|
|
|
|
Thanx,
Would the following destroy the dialog window?
<br />
void ChildDlg::OnClose()<br />
{<br />
CDialog::OnClose();<br />
}<br />
llp00na
|
|
|
|
|
To the best of my knowledge, no.
However, maybe I'm misunderstanding what you are trying to do.
Either way, my point was to get you to reflect on whether you really needed to use a modeless dialog in the first place because there is some extra work and maintenance, not to mention the need to communicate that whoever "owns" the dialog should not use the pointer once the dialog executes "delete this".
Modeless dialogs are kinda messy at best, imo. From an MFC standpoint, I think I listed most of the pertinent information one should know if they are determined to use modeless dialogs in their app.
I hope that helps.
|
|
|
|
|
Thank you, I am grateful
llp00na
|
|
|
|
|
how to execute exe when system is going to shut down using mfc programming?
|
|
|
|
|
Write an application that catches the WM_QUERYENDSESSION message.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
|
Have a look here[^] for info about the message.
When you receive the message you can act on it by doing what is supposed to be done when the system shuts down or the user logs off.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I want to run exe when I select Shutdown in start menu
|
|
|
|
|
Hi everybody,
how to overwrite part of an existing file without loosing the remaining information???
ex: file contains info about employees loke empId, salary,Company etc. Now if i want to change company name of a specific employee Id how to achieve it??
|
|
|
|
|
What is the format of the file ?
Me think you will need to load the file in memory, modify the structure internally and write back to the file.
|
|
|
|
|
Hi all,
I have successfully created a notify icon, but how can I create a balloon pop up, when it is created, and let it time out after x amount of time ??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you for the help _AnShUmAn_
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
HI
I want to get two keys from the keyboard simultaneously , I mean when you press and hold two keys the kbhit() and getch() functions return only the first pressed key .
thanks
|
|
|
|