|
Christian Graus wrote: It means I spend too much time answering questions and not enough doing my own work
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
shivditya wrote: what means Microsoft MVP?
I believe this will answer your question :- https://www.microsoft.com/mvp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
YatinList::YatinList()
{
m_bHeaderIsSubclassed = FALSE;
m_cImageList.Create(IDB_BITMAP1, 32, 1, RGB(255, 0, 255));
coltype=NULL;
ptr=NULL;
checkarr=NULL;
m_query=NULL;
dbinit=NULL;
startrow=0;
}
|| ART OF LIVING ||
|
|
|
|
|
Hey, I'm trying to find some good information (articles, samples, whatever) on changing the access rights of a process. I believe the API methods include, OpenProcess, GetKernelObjectSecurity, GetSecurityDescriptorDacl, GetAclInformation, SetKernelObjectSecurity, etc.
I am trying to disable some rights in a process like PROCESS_TERMINATE though I am having trouble finding some good information.
Thanks all
Luke
|
|
|
|
|
After u OpenProcess, u should OpenProcessToken and AdjustTokenPriviliges.
In addition, u'd probably wanna use LookupPriviligeValue.
For some more info and examples search for how to shutdown the syste
HTH
Yakov
|
|
|
|
|
Cool, what privilege name do you use in LookupPrivilegeValue as I can not find something that seems to disable the right to terminate the process.
I had found some things pointing to using Dacl's etc whihc is really annoying, to disable PROCESS_TERMINATE.
Thanks
|
|
|
|
|
|
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++
|
|
|
|
|
|