|
Thank you for the Link, I will try this.
As I described i`m working at a Windows Service. It is a loop that changes things in a database and send mails and things like that, so there is no user in front of the computer at all, and when a message box pops up, the whole service stops, and mails are not sent anymore. So this service has to continue running when an error occurs. I just want the error in a logfile to see what happened and fix it later.
|
|
|
|
|
I see, with no user at the box it makes more sense. Tell me if you run into trouble with the hooking and i will help if i can.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
Hi Folks,
Please tell me how can i obtain the thread id of the window/application which have keyboard focus?
Regards,
John.
|
|
|
|
|
Use GetForegroundWindow() and GetWindowThreadProcessId (...).
|
|
|
|
|
Hello,
I have an owner-draw listBox that while updating its flicks, I tried the solution of treating the event OnEraseBkgnd its didn't work, so I tried the other posibility - double buffering
void CIconListBox::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
HDC memDC1 = CreateCompatibleDC(lpDrawItemStruct->hDC);
HBITMAP hMemBmp = CreateCompatibleBitmap(lpDrawItemStruct->hDC,
scrW, scrH);
HBITMAP hOldBmp = (HBITMAP)SelectObject(memDC1, hMemBmp);
CDC *memDC=CDC::FromHandle(memDC1);
.
.
if(m_pImgClose)
m_pImgClose->Draw(memDC,0,pt1,ILD_NORMAL);
.
.
memDC->DrawText(line.word[1].str, -1, &rText, DT_LEFT);
.
.
SetTextColor(memDC1,oldcolor);
.
.
BitBlt(lpDrawItemStruct->hDC, 0, 0, scrW, scrH, memDC1, 0, 0,
SRCCOPY);
SelectObject(memDC1, hOldBmp);
DeleteObject(hMemBmp);
DeleteDC(memDC1);
}
for some resone its doing the background black instead of white as it was before the double buffer.
if anyone know what is my problem ,I would be very greatfull for him.
|
|
|
|
|
Before drawing on your memory device context, have you ever filled its background color? The CreateCompatibleBitmap produce a bitmap initially black, then you need to fill it with the color you want, e.g. using the CDC::FillSolidRect (MFC)[^] API.
|
|
|
|
|
thank you very much its solved my problem
|
|
|
|
|
Hi Guys, I am developing a MFC application using Microsoft Visual Studio 2008, i have a strange error, i dont know how to solve it, if any one know pls tell me the reason..
Error 1 general error c101008a: Failed to save the updated manifest to the file ".\Debug\Account Pro.exe.embed.manifest". The parameter is incorrect. mt.exe
|
|
|
|
|
I regularly see the same error with Visual C++ 2010 Express, but a rebuild always fixes it. I suspect some timing issues in the build process that causes mt.exe to fail. I have not researched the solution since it is always recoverable.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
I experienced too the same issue. Searching the Internet, I found an explaination of it: the build process basically moves through 3 steps:
- compiling
- linking
- embedding manifest
After the linking stage, you have a new exe file on your output folder, and the Manifest Tool (mt.exe) is called on it to embed the application manifest. If you have an AntiVirus that perform real-time scanning, is possible that immediately after the linking stage and before that the Manifest Tool gets access to the executable file, it find the new executable and lock the file to scan it for viruses; in that case, the Manifest Tool gets the file locked for writing and fails.
|
|
|
|
|
An interesting analysis; but I wonder why it only ever affects the manifest builder and never the compiler, linker or any other program I run?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
It is not so strange for me: let's assume that the AntiVirus real-time scanner only scan executable files... Then the compiler could not be affected, because it gets source files and produces object files; the linker could not be affected because it gets object files and produce an executable file, but the AntiVirus is not able to scan the created executable until the linker closes the file. Then it seems that the only one tool that could be affected is the Manifest Tool as it gets an executable file that already exists and open it to modify its content.
Anyway, this is the only one explaination that I found, but I'm not sure that it's correct nor that it could be the only one reason for the Manifest Tool to fail... I found too something about this issue on the official technical blog of the VC++ team, and I wonder that they simply said: "after our tests, we was not able to reproduce the issue"
|
|
|
|
|
Yes, that makes sense, I may try modifying my anti virus settings to see if it has any effect.
Thanks for your comments.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Hi,
How to set control ID at runtime?
|
|
|
|
|
You can use SetWindowLong[^] e.g.:
SetWindowLong(handle_to_your_control, GWL_ID, the_new_id);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
I'm testing in Dialog based Application.
I've remove the default title bar and draw bitmap in client region.
The problem is that when I set menu in this dialog, menubar is appeared at top of screen ,above of the bitmap titlebar.
How can I change the position of Menubar?
|
|
|
|
|
If you're not using the default title bar and drawing your own, then you will need to do the same in the case of its menu also.
You will need to draw the menu yourself and handle the button clicks on the menu items.
|
|
|
|
|
Is there anyway to create an Office 2010 style ribbon (Aero tabs and Backstage) with Microsoft's Windows Ribbon Framework?
|
|
|
|
|
Hi,
The accurate answer is no.
The current Windows Ribbon Framework formerly known as Scenic Ribbon has limits, at least:
- no built-in support for MDI maximized icons (near the help button in Office),
- no expansion button bottom right of tab groups,
- application menu not expanding to full window size as Office Backstage.
Usually the Office controls are one step ahead the system ones, so we may expect the Office 2010 features in the Windows Ribbon when Office 2014 will introduce new ones
cheers,
AR
Relook your Old and New Native Applications with a Ribbon UI under Vista or Windows 7 (WTL)[^]
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
Gave a program for a friend to test, as soon as he launched he was notified with this error.
The procedure entry point RegGetValueW could not be located in the dynamic link library ADVAPI32.dll.
I went back to the drawing board only to find out that it is only called after the user has interacted with the program.
So it's not something I'm doing during startup of the application!
|
|
|
|
|
There is a call somewhere in your program to this function. The program loader checks all calls at initialisation to ensure the program can execute correctly. It appears that your friend's PC must have a very old (i.e. non Unicode) version of the system libraries.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
The Requirements for RegGetValue are given by MS as:
Minimum supported client: Windows Vista, Windows XP Professional x64 Edition
Minimum supported server Windows Server 2008, Windows Server 2003 with SP1
Is your test running on one of these?
|
|
|
|
|
I thought does was an old function available since Windows 2000.
Any idea how to get a previous older function?
|
|
|
|
|
You can use the RegQueryValueEx function which is available in older OSs.
|
|
|
|
|
You may like to look at RegQueryValueEx()[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|