|
Logically.....
You can add that xml file as a resource in a DLL that u are using as a custom action DLL.(No need to call InitCommonControls() in that case.)
By doing that ur DLL will get elevated privileges to read/write registry entries on Vista.
Sameer Thakur
|
|
|
|
|
Hi sameer
Can u tell me what actually done in this XMl...
How it helps to edit registry
And how Custom Dll Handles it...
Manjunath S
GESL
Bangalore
|
|
|
|
|
In Vista there is a concept of User Account Control (UAC) by which it prevents any major changes in registry (though you are logged in as an Admin).
To enable registry changes, we need to provide higher privileges to the application.
To do this there is a tag in manifest.xml …
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="highestAvailable"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
Here we are granting the “highestAvailable” privilege to the application/DLL which ultimately grants the permission to ur application/DLL to access (Read/Write) registry.
Sameer Thakur
|
|
|
|
|
Thanks sameer
I will try this and udapte ...
Manjunath S
GESL
Bangalore
|
|
|
|
|
What happens on Vista? Post your code.
|
|
|
|
|
Hi guys,
I tried with embedding the manifest.xml in my Dll as posted in the previous reply to write registry entry in windows vista. But this fails to create any effect (my Dll could not create the registry entry)
Manjunath S
GESL
Bangalore
|
|
|
|
|
The XML that specifies what execution level you want only makes sense for EXEs, not DLLs, since the execution level applies to a process as a whole.
|
|
|
|
|
Hi Mike,
How can i achieve ( writing to registry ) In vista using DLL...
Manjunath S
GESL
Bangalore
|
|
|
|
|
Please refer this[^].
Regards,
Paresh.
|
|
|
|
|
HI paresh,
Any sample code to writing a registry entry In vista using DLL...
Manjunath S
GESL
Bangalore
|
|
|
|
|
Hi,
In my poject want to disable and enable ToolBar Button(save,open,new..)
at runtime using view class.
I had used following code but this code not work properly(abnormal termination error are occure)
CToolBar m_wndToolBar;
m_wndToolBar.GetToolBarCtrl().SetState(ID_FILE_NEW,TBSTATE_ENABLED);
m_wndToolBar.GetToolBarCtrl().EnableButton(ID_FILE_NEW,FALSE);
Please help me....
|
|
|
|
|
mohindar_kks wrote: m_wndToolBar.GetToolBarCtrl().SetState(ID_FILE_NEW,TBSTATE_ENABLED);
Are you sure, GetToolBarCtrl is returning some valid pointer. Probably, it is returing NULL value.
mohindar_kks wrote: (abnormal termination error are occure)
This statement leads to above guess.
Prasad
MS MVP - VC++
|
|
|
|
|
Hi,
Am also try to run the following code, here also abnormal termination error are occured
CToolBar c_oToolBar;
CToolBarCtrl & a_roCtrl = c_oToolBar.GetToolBarCtrl();
a_roCtrl.EnableButton(ID_FILE_OPEN,FALSE);
|
|
|
|
|
I am not sure about the approach that u have specified here.
But the following approach will server the purpose of enabling / disabling the tool bar controls.
You need to add a function in your view class.
For example…
Add ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileNew ) at location shown.
CMyView.cpp
file
=======================================================
BEGIN_MESSAGE_MAP(CMyView, CScrollView)
//{{AFX_MSG_MAP(CMyView)
other message handler functions...
ON_UPDATE_COMMAND_UI(ID_FILE_NEW, OnUpdateFileNew )
other message handler functions...
END_MESSAGE_MAP()
Void
CMyView:: OnUpdateFileNew(CCmdUI* pCmdUI)
{
if( some_Condition)
pCmdUI->Enable(true);
else
pCmdUI->Enable(false);
}
CMyView.h file
Public:
void OnUpdateFileNew (CCmdUI* pCmdUI);
Framework will keep calling OnUpdateFileNew function frequently and will keep the tool bar option enabled or disabled in a way u want.
Sameer Thakur
|
|
|
|
|
I had solve the problem from your valuable reply
|
|
|
|
|
Excellent.
Sameer Thakur
|
|
|
|
|
You're getting a failed assert because m_wndToolBar is just a C++ object, it's not a window so you can't use the methods that operate on the underlying toolbar window.
|
|
|
|
|
Is Microsoft still investing on the development of MFC or is giving it up and rather concentrating on the .Net ?
Will applications written on MFC have their future ?
|
|
|
|
|
What do you mean by "future"? I find it to be an extremely vague term here. I will not explain you it in great detail, but "MFC is something that should not be compared with .NET", for the obvious reason why and where these technologies are employed. If MFC had to die, it must have been buried by now. There are more exciting things, but MFC won't die. It may rather take a different form. May be. Read more on managed and unmanaged code.
Shog on learning VB6: Ah, that would have been VB6. Kicked my ass anyway. So easy to learn, just like falling down a flight of stairs...
|
|
|
|
|
You say "should not be compared with .Net" because one is compiled, and the other is interpreted, so MFC will not die because it serves the domain of the application that needs fast execution and total control on the memory, pointers,etc.
I am still having that idea, but I am seeing many things, look at DirectShow, we now have DirectShow .Net, thus performance and fast execution of code (a critical thing for video codecs,etc and most importantly the direct access to memory : the pointer is real and is not wrapped (image=pixels, and imagine what happens if in the middle of a DCT or FFT, the garbage collector decides to trim the image pixel matrix to ensure memory defragmentation!!!!!??????) in spite of that all i'm seeing those other things brahmma.
I agree future is vague, but of course I do'nt mean the simple execution of programs written in MFC: those written in MFC 1.0 of 1990 still execute in Windows Vista, let it general, look at companies developing user interface control, those offering mfc (bcgsoft,jockebox,prof-uis, etc) are bypassed by the tremendous companies fs offering kits for .Net.
The future of MFC wo'nt be affected by the companies that serves that ?
|
|
|
|
|
charfeddine_ahmed wrote: You say "should not be compared with .Net" because one is compiled, and the other is interpreted,
Why are you assuming things? I said it could not be compared, mainly because of where and how these technologies are employed.
I would again tell you, MFC is not going to die. Not anywhere in the near future, at least. It might take a different form, *may be*.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
No no brahmma, I forgot to put the question mark at the end of the first sentence, I was posing a question, not assuming things, because that's the only thing I know as a difference(code execution) with the other fact that mfc developers gain a full and direct control of memory, unlike C#, VB.Net, where even an int is a complex placement in the RAM, and conversion can't be done on the basis of knowing the exact internal structures of your variable, and also data can move (GC) undeterministically (with regard to your own program execution flow)..
I heared some news that MFC is going to be sold such that Microsoft will no longer improve it.
|
|
|
|
|
charfeddine_ahmed wrote: Is Microsoft still investing on the development of MFC
Yes, it is, according to this report from the MVP summit by Joseph Newcomer.
Best wishes,
Hans
|
|
|
|
|
It would seem that Microsoft have focused on .Net
I don’t think mfc will die anytime soon, I will still be using it for quite sometime.
I’ve worked with standard C to cs.net
I like mfc it allows me to create a quick GUI for testing c++ apps, which .net does but after I put it in a wrapper, sing a song, dance around the office etc.
mfc just isn't as easy as .net thats why .net is so popular its quick and easy (nearly) everything is just a system.iwant.myapp.todo.thisplease namespace away
However .net is great for the app that has been done before or the pretty buttons etc, i'd like to see more info from Microsoft on MFC... doesn’t bother me though.
Long live mfc!
|
|
|
|
|
charfeddine_ahmed wrote: Will applications written on MFC have their future ?
offcourse !.. cobol and fontron still have future!
"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
Support CRY- Child Relief and You
|
|
|
|