|
|
Thanks for the reply.
What I am trying to do is disable the user from killing the app in task manager.
first the program enabled SE_SYSTEM_NAME and then open the current process with ACCESS_SYSTEM_ALL (or something, dont have the code infront of me). Then I use GetKernelObjectSecurity to get the Dacl of the process and I adjust that by adding a AddAccessDeniedAce for the PROCESS_TERMINATE mask. and apply that to the Security descriptor and use SetKernelObjectSecurity to set it. Now this work for Windows NT. the task manager gets a 'access denied' when trying to kill the app. But in Win XP the Task manager gives itself the SE_DEBUG_NAME rights and can kill the app.
How do I get around this? other programs acheive this, like some firewall apps still return access denied when trying to kill the task in Win XP.
I understand using the kill cmd line tool from one of the SDK will always force the app to die. but I want to be able to stop the task manager form end task the app. Any ideas?
Thanks
Luke
|
|
|
|
|
I use the EnumJob to get the job from printer my local or network printer.
every job include pszdocument,page,bytes,user so on .
if I use microsoft word to print,the pszdocument is only the file name,just "microsoft word 11.doc".
but if Use UltraEdit to print,the pszdocument is the file's full path,just "c:\\tmp\1.txt".
why?
I want to know the file's full path by using word to print,
how to do that?
-- modified at 21:19 Sunday 30th October, 2005
|
|
|
|
|
The pDocumen member of the JOB_INFO_2 structure points to a null-terminated string that specifies the name of the print job, as it was communicated by the thread/app which ordered the printing. MS Word communicates something like this: MS-WORD: YourDocument.doc, while UltraEdit seems to communicate more.
You / we must think of another way of getting that information (if possible)
SkyWalker
|
|
|
|
|
i have been tring to write a program that can perform common tasks by voice. i am using microsoft visual c++ 2005 express edition beta 2 (had other problems with so if anyone knows of anything better that is free, since i only do programming as a hobby right now, that would also help).
i need help with the voice recognition. i have downloaded the microsoft speech sdk 5.1 and have tried the examples with it but when i try to compile the examples it gives me several errors. i have also searched this website and search engines for some help but i cannot find any thing that helps. the ones on this website helped a little bit but most of the code they used gave me errors such as undefined variables when i try to compile them. i dont know if there are other include files that i am forgetting or what.
the include file sphelper.h also gives me several errors by itself when i try to include it in any program.
i have also been trying to make a tree view control to display the list of commands from the xml file that i have so if anyone knows how to do this it would also help me out a lot.
any help would be greatly appreciated (code samples and tutorials are extremly helpful)
thank you in advance for the help.
- Kyle
|
|
|
|
|
gr8coaster329 wrote: but most of the code they used gave me errors such as undefined variables when i try to compile them.
Perhaps if you posted some code.....
gr8coaster329 wrote: the include file sphelper.h also gives me several errors by itself when i try to include it in any program.
Each version of VC becomes more standards compliant. Perhaps the library is not compliant enough for VC2005 ?
gr8coaster329 wrote: i have also been trying to make a tree view control to display the list of commands from the xml file that i have so if anyone knows how to do this it would also help me out a lot.
Which bit are you stuck with ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
the code that i used i just copied and pasted from the articles:
typedef struct tag_key
{
int mid;
int pid;
int chd;
HTREEITEM hItem;
HTREEITEM hParent;
char txt[32];
char ref[128];
}KEY;
KEY aKeys[NUMBER_OF_KEYS];
HRESULT CWebVoice::LoadGrammar()
{
USES_CONVERSION;
HRESULT hr;
SPPROPERTYINFO pi;
ZeroMemory(&pi,sizeof(SPPROPERTYINFO));
pi.ulId = RID_MenuItem;
pi.vValue.vt = VT_UI4;
for(int i=0; i < m_nNumKeys; i++) {
pi.vValue.ulVal = i+1;
hr=m_cpGrammar->AddWordTransition(hRule,NULL,
T2W(aKeys[i].txt),L" ",SPWT_LEXICAL,1,&pi);
if(FAILED(hr)) return hr;
}
pi.vValue.ulVal = 0;
hr=m_cpGrammar->AddWordTransition(hRule,
NULL, L"*", L" ", SPWT_LEXICAL, 1, &pi);
if(FAILED(hr)) return hr;
hr=m_cpGrammar->Commit(NULL); if(FAILED(hr)) return hr;
hr=m_cpGrammar->SetGrammarState(SPGS_ENABLED); if(FAILED(hr)) return hr;
return hr;
}
and other code from http://www.codeproject.com/audio/WebVoicePkg.asp[^] and http://www.codeproject.com/cs/media/tambiSR.asp[^]
i dont know how to do any of the speech recognition code. all i know, from other articles, is that you have to initialize the sapi, load the grammar, and something with the recognition contex thing. i dont know how to do any of this or anything else with the voice recognition.
and if not asking too much, how to display the UI's associated with the speech sdk, the user profile, mic training, user training, engine properties and the other ones like that. i have the buttons but dont know the code that displays them, i found the displayUI function but am not sure how to use it.
Christian Graus wrote: Each version of VC becomes more standards compliant. Perhaps the library is not compliant enough for VC2005 ?
so what do i have to do to get it to work?
Christian Graus wrote: Which bit are you stuck with ?
i have the xml document and the tree view control i just dont know how to get the contents of the xml put into the tree view.
thank you for the help and fast reply.
- Kyle
-- modified at 21:37 Sunday 30th October, 2005
|
|
|
|
|
gr8coaster329 wrote: m_cpGrammar
This is a member variable, have you created it ? If not, this code snippet will indeed give you the error you describe
gr8coaster329 wrote: so what do i have to do to get it to work?
Use VC2003, if there's no VC2005 version, and assuming this is the problem. I would assume otherwise though.
gr8coaster329 wrote: i have the xml document and the tree view control i just dont know how to get the contents of the xml put into the tree view.
Well, you need to iterate through the XML, I assume it's a tree shaped structure, or you'd just use a list box, right ? So, you need to use recursion to iterate through all the XML nodes, and then one by one add them to your tree. I'm sure there are plenty of articles out there on XML->tree ctrl ?
If you've found a CP article, try compiling and running the code from the article, that gives you code that is known to work, and lets you debug your own environment. It also gives you a starting point to experiment and learn from.
Also, try asking API specific questions in the forum for the article. I sure know nothing about the speech API.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Christian Graus wrote: This is a member variable, have you created it ? If not, this code snippet will indeed give you the error you describe
what all do i have to do to create it? i have never done this before i am still trying to learn programming in my spare time.
thank you again for the help
- Kyle
|
|
|
|
|
You're suffering from a common problem. You want to build the Eiffel Tower, and you're yet to build a sandcastle. Instead of copying and pasting code almost at random, you should buy a beginner book on C++, and work through it. Then, when you can interpret the code you're copying, you may have a shot at making it work.
Yes, if we posted back and forth four more times, we might get past this problem, but it would not help you in the long run. You're biting off more than you can chew. Buy a book ( teach yourself C++ in 24 hours is a good one ), and ask questions here when you get stuck, but work through it. Then try a few simpler projects, before you start trying to manipulate COM objects and otherwise use more complex APIs.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
How to use GridCtrl? Please tell me, thankyou!
czh
|
|
|
|
|
What grid control ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
does anyone here ever seen a linux-style copy-paste function for windows (I would assume it will be a shell extension)?
I mean, copy by marking (whatever you mark goes into the clipboard) and paste with the middle button.
Best
Noam
Noam Ben Haim
Project Leader
MobilEye
noam.benhaim@mobileye.com
|
|
|
|
|
Nope. But it can be implemented in an app or even system wide.
Regards,
Yakov
|
|
|
|
|
I created a List Control(CListCtrl) with Report type, and I created two columns for it.
I've been able to have the List Control display my data looked up from a database.
and now I want to modify the data in the List Control and write back to the database, is it possible to do this with List Control? if not, what should I do?
by the way, generally I want to keep the look of the report-type List Control.
any info is appreciated!
-------------------
I am learning C++ and English
|
|
|
|
|
The list control can neither read from or write to your database. But in the same way that you've looked up data and displayed it, so long as you're retrieving the primary key for records in the database, there's no reason you can't write back changes.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I retrieve the record in the database with a CDaoRecordSet object.
of course I write back data with this CDaoRecordSet , too, but it seems that the data in the List Control can not be changed by the user, this is the problem .
besides,is CDaoRecordView an alternative?
-------------------
I am learning C++ and English
|
|
|
|
|
Oh, I see. You need the MSFlexGrid, or Chris Maunders grid control ( on this site ). They give you a more flexible control than the listControl.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
I don't have permission to access that image.
I believe that either a list control or a list view allows editing, but you need to write a bit of code to make it work. You should check out the C++ controls section of the site.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I see ,thank you so much all your help
-------------------
I am learning C++ and English
|
|
|
|
|
Hello,
in good old Atari-days I used to love my ramdisk. On PC this doesn't seem to be a serious topic (I wonder why).
Compilation-time is the dominant bottleneck for most C++-programmers. So, in times of GB-Ram: why not use a ramdisk to reduce the heavy amount of harddisk-access?
Has anyone experience in setting up such an environment?
(which ramdisk? how large? what moved to the ramdisk: the temp-dir? the PCH? the whole project-files? how to setup this in VC++ ?
expected speed-gain?)
Thanks
Christof
|
|
|
|
|
Christof Schardt wrote: On PC this doesn't seem to be a serious topic
The current generation of PC's and Windows has overall better performance when any 'extra' available RAM is left to the operating system. Windows uses a portion of free RAM as a disk cache (there's the RAM disk you wondered about). The advantage today is that the O/S manages it for you, and you don't have to worry about copying files back and forth.
There are a number of things you can do to improve build performance. Make sure that any header files that don't change a lot are included in your precompiled headers. Break your projects into smaller pieces that are linked into the final application as object libraries (.LIB's), or even at runtime as DLL's. Your objective here is to reduce the amount of code that gets recompiled when you make changes, rather than to decrease the overall compile time itself. Most of the time, you are working on a small portion of the code, and don't need to recompile the whole thing.
Software Zen: delete this;
|
|
|
|
|
You can also try to use the
#pragma once
in your header fils so they are not parsed multiple times, even if included multiple times.
I also find that keeping my HD defragmented helps a lot too.
If you run a virus scanner with 'on access' scanning, disable the folders containing your source files.
Disable some output options you might not use, such as class browser (I don't use it, speeds up build times since not making the BSC file for each project).
|
|
|
|
|
Of course I have an include-guard in all my headers.
BTW:
Is there a difference between
<br />
#pragma once<br />
...
and
<br />
#ifnded XY_INCLUDED<br />
#define XY_INCLUDED<br />
...
#endif<br />
or is it just a MS-shorthand for this?
Thanks anyway for your additional hints.
Christof
|
|
|
|