|
Thanks for the link. I noticed that it does not use time. So with this code am i able to handle the case when diskio takes long time to read any data (say 4-5 minutes).
For my case my program reads any data in few seconds but at one offset it takes some minutes to read some data (sometimes hour). Will this code solve that problem? If not then what is the solution? Should i attach the sample source code here which use overllaped io.
|
|
|
|
|
Hi,
I need to customize a CMFCPropertyGrid such that be able to display a simple button inside.
when user selects given grid, user can press button inside and then a dialog box will be displayed!
exactly like Folder dialog box.
how can i do this?
best regards
|
|
|
|
|
Hello Friends
I am using libtiff library and m writing a simple tiff file.I setted the basic tags like imagewidth,height,compression,bitsperpixel,tiff tag orientation and finally image data by using tiffWritescanline. And image is saving as tiff too but now i want to save another layer data in same tiff so for that Do I need to save only image dat or do I need to set basic tag again for that layer too?
Any Help will be appreciated.
Thanks & Regards
Yogesh
|
|
|
|
|
Hello Guys
I found one tag TIFFWriteDirectory in Libtiff but it is creating multiple pages and I want layers in tiff that can I open photoshop and edit it.
Any Other Tag which can make images as Layers?
Thanks & Regards
Yogesh
|
|
|
|
|
TIFF files can contain multiple images (also called "pages"), which are stored in "directories". but again, there is no explicit support in the TIFF format for "layers".
to write N images to a TIFF file, you:
0. open the TIFF file
1. set all the image tags for image X
2. write the image data for image X
3. call TIFFWriteDirectory
4. X++
5. while X < N, goto 1
TIFFWriteDirectory creates and initializes a new tag directory in the TIFF file.
you can also add new pages to an existing TIFF file by opening the file in append mode.
|
|
|
|
|
Chris Losinger wrote: there is no explicit support in the TIFF format for "layers".
According to this[^] (and other sources), there is.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
not really a lot of detail there.
a file search of the latest LibTiffs (3.9.4 and 4.0.0 b6) turns up three instances of the word "layer", none of which refer to Photoshop-style image layers - they refer to API layers, etc..
if there is layer support in TIFF, it must be very new, and so is unlikely to be what Photoshop has been using for years.
|
|
|
|
|
Hi all,
i was looking for a way to change the tooltip of the toolbar's buttons !! i tried to look for it on google but there is nothing versatile.
I'm using Visual Studio 2005 and an MFC project !!
Thank you
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
I believe you would want to send TTM_DELTOOL message to your existing tooltip control to delete the current text, followed by a TTM_ADDTOOL message with the new text. Alternatively, I think you can use TTM_SETTOOLINFO to modify the text of an existing tooltip - that may be simpler.
The following snippet shows the syntax for TTM_ADDTOOL and may point you in the right direction, although the code is WTL instead of MFC:
TOOLINFO info;
ZeroMemory(&info, sizeof(TOOLINFO));
info.cbSize = sizeof(TOOLINFO);
info.hinst = _Module.get_m_hInst();
info.uFlags = ( TTF_CENTERTIP | TTF_ABSOLUTE);
info.lpszText = _T("Your new text here.");
m_Toolbar.GetItemRect(m_Toolbar.CommandToIndex(ID_TOOLBAR_BUTTON_TO_CHANGE ), &info.rect);
info.hwnd = m_Toolbar.m_hWnd;
info.uId = ID_TOOLBAR_BUTTON_TO_CHANGE;
::SendMessage(tt, TTM_ADDTOOL, 0, (LPARAM)&info);
L u n a t i c F r i n g e
|
|
|
|
|
I drived a class from CFormView. But If I override OnInitUpdate it is not executed in my drived class.
Could you help me why this is happening?
|
|
|
|
|
Can you give us a sample of the OnInitUpdate function? We can't really make any educated guesses without any clues.
|
|
|
|
|
john5632 wrote: But If I override OnInitUpdate it is not executed in my drived class.
How are you verifying this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
may be u forgot to attach the ID of the form in the .H classe file !!
is the form loaded or no ? and what kinf of errors do u ve got ?
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Hallo,
I have a Windows Service written in Visual C++. It`s a loop that does certain things, and starts from the beginning after waiting a few seconds.
My problem is, that when there occurs an error in the code, a messagebox pops up. And the code is not executed anymore, because you have to click on "ok" first. The messagebox is showed from some external library functions, so I can`t go to the source code.
Is there any possibility to redirect all message boxes to a logfile or something like that, and continue executing the program without a click by the user?
Thank you!
|
|
|
|
|
Well, first of all, if there are errors popping up, shouldn't you rather try to figure out what causes them and try to fix it, besides, maybe the user has to/wants to know about these problems, so "supressing" message boxes might not be a good idea. Depending on how the message boxes are displayed, i can think of a possible way to do what you want if you insist.
> 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. <
|
|
|
|
|
Code-o-mat wrote: i can think of a possible way to do what you want
Please show how can the ::MessageBox() can be suppressed and corresponding message be directed to some file.
|
|
|
|
|
Sorry for the late answer, wasn!t near net access for a day. So, you could try hooking the MessageBoxA and/or MessageBoxW API functions and provide your own implementations to write to a log file. I don't know what you are actually doing so i can't really judge but i still don't think supressing message boxes intended for the user is a BAD IDEA. Anyways, for api hooking, see API hooking revealed[^] here on Code Project.
> 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. <
|
|
|
|
|
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
|
|
|
|