|
The best way to track these down for yourself is to start with the menu resource. Look at the command ID for the given menu item (such as ID_FILE_NEW). Then do a Find in Files for that ID (match whole words and case to speed up your search). You'll find the message map entry for that command, telling you the name of the function that handles it.
You will find all of these in your MFC\Src directory
Scot Brennecke
Software Developer
VC++ MVP
|
|
|
|
|
I want to close my modeless dialog spawned by a CFormView mDI using the right hand side cross on the title bar, and send a message plus do some housekeeping when the cross is clicked. I put (for testing) message boxes in
1. DestroyWindow()
2. OnDestroy()
3.PostNcDestroy()
None fired when I closed my modeless dlg with the cross (whats is called anyways that cross? )
From my deductions with various combinations I found that closing the modeless with the cross does not invoke any destroy type function. Once spawned (and even if closed thereafter with the x), only when the whole app is closed with the cross, do the messageboxes fire (only for ondestroy and postncdestroy, but not destroywindow))
If I explicitly call destroywindow in the modeless dialog, it of course triggers all three messageboxes.
What needs to be done to override the cross?
|
|
|
|
|
Try overriding OnClose and calling DestroyWindow from there. The cleanup code (particularly a call to delete this if no other part of the code takes care of it) is usually best placed in PostNcDestroy .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thank you,
The WM_CLOSE was the right message sent when the cross is clicked.
|
|
|
|
|
I have some trouble with FTP download. I'd like to make files downloaded from server as current information, but the server seems to use memory cash. Suppose that there's a file called "aaa.txt", and I downloaded. It's OK for the first time. But when the file is changed in the server even though it still keeps the same filename as "aaa.txt", I can't download the new aaa.txt. Instead, the previous aaa.txt keeps being downloaded, although the file was certainly changed on the server. The weird part is that the date of file changed in the local hard drive, so I thought it was updated as the new file at first, but everything(except the date) is same as the previous file.
I just used "GetFile" for downloading.
How can I refresh it and download changed files?
Please give me some advice! Thank you.
|
|
|
|
|
I'm not sure I understand your problem entirely, but could it be that you as user have an -outdated- version of the file in your temp internet files folder, created at the first time you downloaded it?
If that is the case, then you might look at CWebGrab a class by Chris Maunder, which has a force reload function. You can find it here. It is an http download class though, but I think the SetForceReload() function should be helpful.
Regards,
Griffith
Everything you say will be misquoted, ripped out of context and used against you.
|
|
|
|
|
|
Hello!
I want to print the content (CStrings) of a ListBox from a dialogbased MFC-Programm! Can anybody help me?
halloduichbinsnur@web.de
Lucky2002
|
|
|
|
|
|
Hello!
First: Thank you!
But I still have problems with printing from the List Box. Particularly: What do I have to write into the functions: OnBeginPrinting, OnPrint, OnEndPrinting. Must I change something in the Print-function?
Can anybody help me more exactly? I only want to print the content (CStrings) of a ListBox from a dialogbased programm.
Thank you very much!
Have a nice day!
Lucky2002
|
|
|
|
|
For very simple printing, you can leave the OnBeginPrinting() and OnEndPrinting() functions blank. You can do all your printing in OnPrint().
Simply use CListBox::GetText() to get the strings from the listbox, and CDC::DrawText() to print the strings onto the printer. Just be sure to update the rectangle that DrawText() uses so that you do not print all the strings on top of each other. The CPrintInfo::m_rectDraw variable contains the coordinates of the printable portions of the page.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
Hello!
I'm sorry, but I still have problem with the printing functions. The member-variable of my ListBox is m_ctrlListBox.
I wrote in the OnPrint(CDC *pDC, CPrintInfo* pInfo)-function:
CString s;
m_ctrlListBox.GetText(0,s);
CRect g(2,2,2,2) ;
pDC->DrawText(s,g,DT_LEFT || DT_TOP);
The problem: My print is empty!
Can anybody help me??
Thank you very much.
Lucky2002
|
|
|
|
|
The first thing that comes to mind is that your CRect g is too small. you are trying to draw the text into a 2x2 pixel area. The second is to make sure that GetText() is actually getting the text and that CString s is not empty.
try CRect (0,0,pInfo->rectDraw.right, pInfo->rectDraw.bottom);
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
Hello!
Thank you very much, it works!
Now I have the next Problem:
Only the first CString is printed, but I want to print the whole content of the ListBox.
First I made a for statement:
CString test;
int anz=m_ctrlListe.GetCount();
for(int i=0;i<anz;i++)
{
this-="">m_ctrlListe.GetText(i,test);
CRect g( 750,750,pInfo->m_rectDraw.right,pInfo->m_rectDraw.bottom);
pDC->DrawText(test,g ,DT_LEFT || DT_TOP );
}
It is logical, that only the last entry is printed.
How must I update the CRect to print the whole content of the ListBox.
Thank you very much!
Have a nice day.
Lucky 2002
|
|
|
|
|
DrawText() returns the height of the text drawn, so simply increase g.top by that value before you draw the next line.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
Hello!
I still have another problem:
for (UINT page = Info.GetMinPage();
page <= Info.GetMaxPage() && bPrintingOK;
page++)
{
dc.StartPage();
Info.m_nCurPage = page;
OnPrint(&dc, &Info);
bPrintingOK = (dc.EndPage() > 0);
}
Info.GetMaxPage returns the value 65535.
But in my example it must be only one site.
If I set page=1, it works. But maybe later I want to print more pages.
Where can the mistake be?
Thank you very much.
Greetings
Lucky2002
|
|
|
|
|
If that's all you want to do, and don't need ano of the "fancy" GDI stuff, just open LPT1: and write the chars to it.
|
|
|
|
|
Hi there,
In a dialog based application, I need create a window with spliter
control. In the creation of the MSVC Formview class, i find a debug error:
"Error: Dialog with IDD 0x%04X must have the child style" (lpszResource).
Where can i set this style?
This is also the problem I required last night with detailed source code.
http://www.codeproject.com/script/comments/forums.asp?forumid=1647&fr=26
Thanks for all the replys!
Best regards,
chen
|
|
|
|
|
chen wrote:
Where can i set this style?
In the dialog resource editor:
Rightclick - Properties - Styles tab - Style Combobox - bottom of the list
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Within you lies the power for good - Use it!
|
|
|
|
|
chen wrote:
Where can i set this style?
open the dialog in the resource editor. open the properties dialog; there is a drop down list of styles to choose from; "child" is one (popup is another)
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
anybody knows how to load and "get" into a HFONT a TT font file (like I have myfont.ttf and I want to use it without installing it prior to use)
|
|
|
|
|
see CreateScalableFontResource and AddFontResource
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
I want to create a pdf finder. It can find keywords from the pdf files stored on my harddisk. So I need to know the structure of pdf. Anyone knows the details of the pdf structure? Thanks!
|
|
|
|
|
Hi Ivex,
Have a look at this http://partners.adobe.com/asn/developer/acrosdk/
Regards,
Venet.
--------
Black holes are where God divided by zero.(Steven Wright)
|
|
|
|
|