|
Yes I am an Admin on the machine I am running this query/app..
Here is a code :
//Attempt to open the key on the target.
int retval = RegOpenKeyEx(
hkRegHive, // Hive of the RegKey
pszRegFullKeyPath, // Full path of the key excluding Hive name
0, // Reserved
KEY_READ | (Node32Bit ? KEY_WOW64_64KEY : 0), // Access rights to the key
&hkScanKey); // Handle to opened key
if(retval != NSCOK)
return FALSE;
Ouput : retval = 5
regards,
Supriya Tonape.
|
|
|
|
|
Supriya Tonape wrote: Yes I am an Admin on the machine I am running this query/
That doesn't matter on Vista. You still need to run the process with
elevated privileges to perform certain operations, even if you're an administrator.
Try KEY_QUERY_VALUE instead of KEY_READ. If that doesn't work then your
app requires elevated privileges (you can set this up in the app manifest to
force a UAC prompt).
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am running this application on XP right now but yes includes Vista too though. I will try what you told. will get back to you.
Regards,
Supriya Tonape
|
|
|
|
|
nope KEY_QUERY_VALUE doesnt work.. i am not clear abt 2nd option you told..
|
|
|
|
|
You should be able to read that key.
What's the value of Node32Bit at the time of the call?
What are the permissions set on that key? You can view them in regedit.
Are you looking in your own registry or a registry on a remote machine?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am taking break will reply you after some time. thx for the help!!! appreciate it. (for the time being resolved the prob though.)
|
|
|
|
|
No one cares. Read the site guidelines.
Blog link to be reinstated at a later date.
|
|
|
|
|
Hi,
can I derive a class from CButton and make it not take the focus? Would like to make it only accessible by mouse click, the button should not take the focus from the control which has it, no tab stop is needed. Thanks for help!
|
|
|
|
|
What if you create the button without the WS_TABSTOP style
(or using SetWindowLong() to remove the style)?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi Mark, the button was created without: the resource file has NOT WS_TABSTOP .
|
|
|
|
|
So you're not able to tab to it, correct?
As far as getting focus on a click...
I'm not sure if it will work, but maybe derive a class from CButton,
add a WM_SETFOCUS handler, and in the handler method set focus back to the
window losing focus.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: So you're not able to tab to it, correct?
That's correct. I will try some different things, OnSetFocus handler etc... thanks for the tips!
|
|
|
|
|
Hello,
I am trying to use extended CListCtrl in my C++ MFC MDI application with LVS_REPORT style.
I could find a few very interesting CListCrl extensions here (CGridListCtrlEx is one of).
I need to use it resized to fit whole window. Unfortunetly authors usualy give egzamle how to use it in dialogs.
What is the best start:
Have View class based on CListView (class inheritade from CListView) and try to replace ocurents of CListCtrl with CListCtrlExtensions?
or
Have View class based on CView?
or
CFormView and try to dock CListCtrlExtension to fit whole window? like in http://www.codeproject.com/KB/list/ReportControl.aspx
Sorry for taking time, but I have spent searching, reading and trying and still nothing is clear to me with this ...
|
|
|
|
|
Being contrary, I'll suggest a 4th way...
CListView, CEdit view all inherit from CCtrlView. I suggest inheriting from that yourself, using your control.
So, you can pretty much copy and paste CListView, and do a search replace for your new shiny control instead. Inheriting directly from CListView is probably making too much bodging code.
Iain.
|
|
|
|
|
Thank you very much. I hope to be abele to follow that way
Thomas
|
|
|
|
|
hi,
I am working on an mfc application in which I am using a CTreeCtrl Control. My problem is that I want to have several root nodes instead on one single root node.
These root nodes are having their own child nodes.
The number of root nodes and child nodes are known during runtime.
Please help me.
Thanks In Advance.
Dhiraj Kumar Saini
modified on Saturday, October 25, 2008 7:44 AM
|
|
|
|
|
|
Hello,
I use several controls with the CMainFrame=>CView. These controls are for putting different values like 'amount', 'price', and 'text'. There is also possibility to print all CView content. And the problem is with setting 'what you see is what you get' for CRichEditCtrl.
My CRichEditCtrl is calculated to have 8 cm + some offset width, because text printed, and print previewed has also 8 cm width.
I would like the text in my CRichEditCtrl looked identical as on the printout.
So I use CRichEditCtrl::SetTargetDevice(...) in order to set:
1. Printer DC
2. line width calculated as 8 cm.
After I used SetTargetDevice the word wrapping is the same as on the printout, but there is still very big problem. I mean the text is very often partly shifted out of the CRichEditCtrl in the horizontal view. It looks like CRichEditCtrl didn't have enough space to contain all text width, but it is not true. It really has 8 cm + offset. The line set with SetTargetDivice has also 8 cm width. So I don't understand why the CRichEditControl does not contain whole text width. I checked the same text, with the same font setting, with the same margin in the MS Word, and in MS Word everything looks fine. Whole text is well fitted.
My question is: Did i miss some setting? What am i doing wrong here? Or maybe I should get "what you see is what you get" in some other way?
I'm including printscreen showing the problem:
http://rapidshare.com/files/157373743/Screen.png[^]
Regards.
|
|
|
|
|
Hi
I want to know how to analyze crash dump created by WinDbg.Please tell me the step by step methods by which one can know actually which function,Class, DLL, line no, is causing the crash.
Thanks...
|
|
|
|
|
|
|
Hi friends
currently my application adding rtf file data to richeditControl using StreamIn() function . but i am not able to add MS word data properly to this control.
Is it possible to add the MS word data to rich edit control using StreamIn() or some another method ?
Plz reply if you know any kind of such method
Thanks and regards
Moris Jasuja
modified on Saturday, October 25, 2008 5:30 AM
|
|
|
|
|
|
Hi,
Is there anyone can advice me on how to reinitialize the OpenGL window in MFC in order to render the file continuously?
Once the program start, it will initialize everything and the OpenGL window will have black window. when user key in word, my OpenGL window have to render the animation. But once I start up the program, the program was run through the render step which is set the OpenGL window into black screen. How am I going to reinitialize the OpenGL window so that it able to render the animation? thank you.
|
|
|
|
|
It is very difficult to understand what you are asking (well, at least for me, maybe it's too early in the morning ).
You would like to have OpenGL 'animations' in MFC but you don't know how to do this ? If that's your problem, you will have to override CWinApp::OnIdle[^] in your application class. This function will be called each time it is in idle and you will be able to render your graphics there. Be sure to return a non-zero value from the function.
|
|
|
|