|
What does the check box "Run as administrator" show
(in the "Compatibility" property page of the result exe), please ?
Here is an example of "any-user" manifest,
that could be bind to an exe:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
virtual void BeHappy() = 0;
|
|
|
|
|
"Run as administrator" is not enabled.
Can you give me some background on the manifest? Does every executable need one under Win7 in order to avoid UAC prompt... or is it some API call inside my exe which causes the UAC prompt?
|
|
|
|
|
// or is it some API call inside my exe which causes the UAC prompt?
May be...
...when it (test) will not help :
- save the XML-dump as c:\yours.manifest
- set the exe-VS\ProjektProperty\Manifest Tool\Input and Output\Additional Manifest Files to c:\yours.manifest
- rebuild
An "admin" API call would just fail, I think,
by filled LastError (about some rights) in the "non-admin" modus...
virtual void BeHappy() = 0;
|
|
|
|
|
|
It could simply be the name of your exe file also. Vista (and Windows 7) UAC also uses heuristics to determine if an application needs admin privilege.
See this article[^] on MSDN (especially the "Installer Detection" part). Even strings in the string table of your application can trigger UAC.
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
krmed wrote: UAC also uses heuristics to determine if an application needs admin privilege.
Yes that's it! The file is a software_updater.exe , the text "update" in file name or version info triggers the "installer detection". Now have to find a way around that, I am curious if I can do the following: 1) keep file name without UAC prompt, 2) elevate privileges on runtime when actually needed. Most time my software updater justs needs to run with normal user rights, only when the main application is updated it would need more privileges.
Btw, if someone is interested, I would have never mentioned the problem if my MSI installer wouldn't have failed. You can't run (non-deferred) custom actions which will then trigger a UAC prompt, they fail silently.
Thanks for the info!
|
|
|
|
|
I have created a new menu in my MDI application,and the menu can be displayed.
However,the window menu can not be properly displayer.
there is no any window name in the popup menu of window menu.
the window menu is on the left of the help menu.
I know the OnCreateClient will get the menu handle,but I dont know why it cannot display properly.
thanks in advance for any kind of help.
Bill
modified on Thursday, September 23, 2010 3:38 AM
|
|
|
|
|
Do not cross-post the same question to multiple forums (you have posted this question to the QA too). The best is to post a question only once in the more appropriated forum.
|
|
|
|
|
you should modify IDR_application menu in resource view.
|
|
|
|
|
First of all,thanks for your help.
I have resolved this problem.
The reason of this problem is that the function GetWindowMenuPopup is not properly implemented.
The MFC frame make use of this function to add window name to the window menu which is on the left of the help menu.
The default GetWindowMenuPopup function look up window menu handle only by the resource ID.If the resource ID of the menu is between AFX_IDM_WINDOW_FIRST and AFX_IDM_WINDOW_LAST,the frame consider it as a window menu.
So when I create a new menu,it's ID is not between the range and the frame doesnot add window name to the window menu.
Now I have overrided the GetWindowMenuPopup in my derived class,it is as below:
HMENU CHotelFrameWnd::GetWindowMenuPopup(HMENU hMenuBar)
{
if (hMenuBar == NULL)
return NULL;
ASSERT(::IsMenu(hMenuBar));
int iItem = ::GetMenuItemCount(hMenuBar);
while (iItem--)
{
HMENU hMenuPop = ::GetSubMenu(hMenuBar, iItem);
if(hMenuPop != NULL)
{
MENUITEMINFO mii;
TCHAR szBuf[256];
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_STRING;
mii.fType = MFT_STRING;
mii.dwTypeData = szBuf;
mii.cch = sizeof(szBuf);
mii.fState = MFS_ENABLED;
::GetMenuItemInfo(hMenuBar,iItem,TRUE,&mii);
if(strcmp(szBuf,_T("窗口(&W)")) == 0)
{
return hMenuPop;
}
}
}
// no default menu found
TRACE(traceAppMsg, 0, "Warning: GetWindowMenuPopup failed!\n");
return NULL;
}
WeatherYoung
|
|
|
|
|
Hi,
I am getting getting time through CTime::GetCurrentTime() but I am getting time in 24 hours format.
How can I change it in 12 hours format?
|
|
|
|
|
AFTER getting currenttime
you can use Format method for changing time format as you want
|
|
|
|
|
The documentation[^] is always the first place to look.
It's time for a new signature.
|
|
|
|
|
CTime::GetCurrentTime() returns a CTime object, not a string, so it has not a format.
To get the formatted string, have you used the CTime::Format function?
Use it with %I instead of %H.
P.S.: you cannot read the documentation on MSDN?
|
|
|
|
|
I am using like
szTimeDisplay.Format(L"%02d:%02d:%0d",tm.GetHour(),tm.GetMinute(),tm.GetSecond());
I also tried as you told but not worked?
|
|
|
|
|
CTime::Format only takes one parameter, and that's a format string. The format is based on strftime rather than the printf style you're expecting. MSDN has an example[^] at the bottom of the page that might give you a leg up in the right direction.
Cheers,
Ash
|
|
|
|
|
use this instead:
szTimeDisplay = tm.Format(_T("%I:%M:%S"))
|
|
|
|
|
Thanks, how to get AM/PM ?
|
|
|
|
|
use %p
szTimeDisplay = tm.Format(_T("%I:%M:%S %p"))
|
|
|
|
|
Hi All
I am using MFC SDI application. We give release version of executable to the customer.
Application get's crahses in real time. I heard through pdb file we can debug the release version. Can any one tell how to use the pdb file. In real time we cannot debug the executable via code. Also it occurs in rare case. Finding the solution is bit difficult. Can anyone assist me in resolving this issue.
|
|
|
|
|
I have not used it to actually debug an application at runtime, but rather used it when analyzing crash dumps from release builds, but I suppose that is possible too. The pdb file contains the symbol information needed to trace instructions back to source code. If the problem occurs infrequently, it might be better to go the crash dump analysis path.
There is a discussion here[^] on how to do this.
|
|
|
|
|
Hi all,
I am drawing one rectangle with some given values and degree.
Now i want to give the mouse event if i click the mouse on that rectangle,it should be activated so that i can drag it and resize.
The code i am using to draw rectangle is:
LPTSTR lpsz;
ColliAngle = "45";
int ang;
ang = _ttoi(ColliAngle);
float Angle = ( 3.142 * ang ) / 180;
int x[4];
int y[4];
x[0] = -x1 * cos(Angle) - y2 * sin(Angle);
y[0] = x1 * sin(Angle) - y2 * cos(Angle);
x[1] = -x1 * cos(Angle) + y1 * sin(Angle);
y[1] = x1 * sin(Angle) + y1 * cos(Angle);
x[2] = x2 * cos(Angle) + y1 * sin(Angle);
y[2] = -x2 * sin(Angle) + y1 * cos(Angle);
x[3] = x2 * cos(Angle) - y2 * sin(Angle);
y[3] = -x2 * sin(Angle) - y2 * cos(Angle);
for (int i=0; i<4; i++)
{
x[i] += center.x;
y[i] += center.y;
}
MoveToEx(pCellInfo->hDC,x[3],y[3],NULL);
for (int i=0; i<4; i++)
{
LineTo(pCellInfo->hDC, x[i],y[i]);
}
Please help me i dont know how to start and totally hanged.
Thanks
Raj
|
|
|
|
|
To identify if the mouse is clicked on the line use the LineDDA function.
This function calls a callback function with each point on the line.
Compare this will the point where the mouse was clicked.
|
|
|
|
|
You can also insipre from here^
|
|
|
|
|
Hallo as in the Subject described how can i convert the Bitmap from the resource to a Wmf file i found an article how to convert it in EMF but not in WMF
can somebody help me
thanks
|
|
|
|