|
Hi I have vc++ 6.0 application and i am trying to port into .Net framework (VS2005). One of my process needs to be run in Admin credentials and for the I have added manifest file in application resource using
(#define MANIFEST_RESOURCE_ID 1
MANIFEST_RESOURCE_ID RT_MANIFEST "Test1.exe.manifest") commands and this get added into resources. I also created the Test1.exe.manifest file and provided credentials as follows:
[
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0"
processorArchitecture="X86"
name="Test1.exe"
type="win32"/>
<description>Description of your application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="true"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
]
Even provided "requireAdministrator" credentials in requirePriviledge tag my application is running with the normal user credentials instead on Admin credentials. While building application with this maifest added it is giving Warning as follows:
[
manifest authoring warning 81010002: Unrecognized Element "requestedPrivileges" in namespace "urn:schemas-microsoft-com:asm.v2"
]
Please let know how to run applcation with Admin credentails.
THanks
SNI
jhghjghj
|
|
|
|
|
Maybe try
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test1.exe" type="win32"/>
<description>Description of your application</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
This is not working. still the output is same.
jhghjghj
|
|
|
|
|
So you voted him down because his suggestion didn't work??
|
|
|
|
|
I guess in all fairness, my answer was unhelpful if it didn't work
I do, however, take that as an indication that I don't need to look
into it any further.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Very true! I've gotten a few of mine voted down too. Is it just me, or has this become a bit more common recently??
|
|
|
|
|
I think it's mostly because there's only two choices for
voting initial replies...could be wrong.
I actually won't stop pursuing the problem if the OP is
doing his/her part on the other end....doesn't seem to be
the case here
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
You aren't going to get many answers if you vote people down for trying to be helpful. It says "Helpful answer" not "Did it do everything you wanted it to, even though you missed bits out".
|
|
|
|
|
Guys you are taking it in wrong way. My intention is to say "NO" just that bcoz the it is not working and it does not mean that it is not helpful. I think there should one more option available to choose "Helpful but not wotking".
jhghjghj
|
|
|
|
|
Alternatively, you don't choose an option and you post a follow up question. Less contentious all round.
|
|
|
|
|
Ok, I fired up the old Visual Studio 2005 and created a new project.
I added a file to the project called MyAppName.exe.manifest
(MyAppName.exe MUST be the resulting EXE file name)
In that file I put the following XML:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test1.exe" type="win32"/>
<description>Description of your application</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.DebugCRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level='requireAdministrator' uiAccess='false' />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Note that your dependeny section may be different - create a simple project
(of type similar to yours - Win32, MFC, whatever) with the wizard, build it,
and examine the created .intermediate.manifest file to get the dependencies.
In the project properties/Linker/Manifest File I set Generate Manifest to no
*edit* this step isn't necessary
In the project properties/Build Events/Post-build Event I added the following
command line:
“$(FrameworkSDKDir).\Bin\mt.exe” -nologo -manifest “$(ProjectDir)$(TargetFileName).manifest” -outputresource:”$(TargetPath);#1″
Built the project - no warnings no errors.
Ran the exe from debugger - got the "requires elevation" error.
Ran the exe from Windows Explorer - got the UAC prompt.
Mark Salsbery
Microsoft MVP - Visual C++
modified on Tuesday, October 14, 2008 2:21 PM
|
|
|
|
|
thanks it is working
jhghjghj
|
|
|
|
|
Hello!
Is there a way I could force .NET to use class derived from ResourceManager (CustomResourceManager etc) instead of ResourceManager itself? The reason I have to do this is that I need to intercept calls to GetObject and modify object returned from it. The only way to do this is to implement my own ResourceProviderFactory which is not good in my case.
Cheers
Dave
|
|
|
|
|
So why not just wrap the ResourceManager with your own class and have it get the object from ResourceManager, modify it, and return it?? Or am I missing something in your description?
|
|
|
|
|
In a C# Windows Forms app, I have a Panel containing some Labels and Pictureboxes. I have set up delegates at the Panel level to handle MouseEnter and MouseLeave Events. I want something to happen when the user moves the mouse into the Panel and out of the Panel.
However, the Panel MouseEnter and MouseLeave Events are firing when the mouse moves into and out of any of the Pictureboxes and Labels within the Panel. I don't want this behavior. I want them to fire only when the mouse moves into the Panel and out of the Panel.
What am I doing wrong?
Thanks,
Mark
|
|
|
|
|
I'd say you're doing nothing wrong. Because mouse moves above another control it leaves the panel, whether the control is inside or outside the panel.
When mouse leaves the panel, you could check the position of the mouse, is it still inside the panel or not. The same logic can be used in MouseEnter. You can get the position from the Cursor class.
Hope this helps,
Mika
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
I ran a search for a System.Windows.Forms.ToolStrip which matches the width it is given but I was only able to find articles about ToolStripItems of one type or another. If this is a repeat, sorry.
I have a ToolStrip with context which can be resized. I would like the ToolStrip to be as large as it can be. Currently the ToolStrip will take the whole line (row) in the ToolStripContentPanel. If I try to drag the ToolStrip beside a ToolStrip which doesn't take up the whole line, the short one shifts down so that the resizable one can take over the whole line again.
Currently on any client size change of the ToolStrip I set the only item to the MaxItemSize to force the ToolStrip to get as large as it can in the ToolStripContentPanel. This doesn't seem to take into account other strips on the same row.
Although this isn't extremely important to my program's functionality, I'm sure you can understand why this is driving me crazy. If you wouldn't mind helping answer my question I would be very thankful.
How do I create a ToolStrip which will take as much width as it can from the content panel without moving other ToolStrips out of the way?
|
|
|
|
|
I am not sure if I completely understand your question but try this:
With a toolstrip in a toolstrip container, set the "Stretch" property to True. Then toggle that when you want to allow the toolstrip to be resized.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
do FileSystemWatcher works with a mapped drive
|
|
|
|
|
Why don't you give it a try?
|
|
|
|
|
The docs state:
"You can create a component to watch files on a local computer,
a network drive, or a remote computer."
I'll let you decide if that means yes or no
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I'll let you decide if that means yes or no
Neither, it means he don't need no stinkin documentation!
led mike
|
|
|
|
|
Hello,
I have an application that I run on my machine with VB2005 .net. Works good.
I take the exe to another machine and the application shuts down. We traced the program to the line:
thisconnection.open() - the application will execute the line but never come back(?). The app will just end.
We think that it is due to permissions or a missing component installed on the 2nd machine.
The program is at this point trying to open an odbc connection to a remote site to get information via sql call. (Again, this will work on the 1st machine without any problems (open, execute and closes just fine the odbc connections).)
Has anyone ever come across this problem or have an idea on a solution?
Sincerely,
Lmnorms1
|
|
|
|
|
lmnorms1 wrote: or a missing component installed on the 2nd machine.
Yes, part of the responsibility of software development is to learn (study, understand, know) about deployment issues. Here are a few of those issues.
* Know how to determine all the components that your application is dependent on.
* Know how to construct an Installer that will install all the components that your application is dependent on.
* Learn how to use Google to find documentation that one can read to learn things that one doesn't know but needs to.
led mike
|
|
|
|
|
Actually, found it. Thank you for the information. The information did help me in building the file properly.
The odbc connection was due to the odbc was not registered. It was built and could be seen in the user dsn but was on showing up in the odbc.ini file in windows. This tells me that it was not registered. Deleted the odbc and set it up again through the ODBC wizard in windows and it worked on the second machine.
Thank you,
Patrick.
|
|
|
|