|
Yha! Maybe your right, I will create a new release exe file with debug information and I will deploy it again. just incase that the problem occur again I will easily debug and saw it in the call stack using the crash address
Thanks again Steve,
Till next time
|
|
|
|
|
I feel dumb for asking this - but:
In VS2005 in an MFC project, how do I add an WM_INITDIALOG - Handler to a dialog?
"Events" only list child controls, and "Messages" does not include WM_INITDIALOG (only gems such as WM_INITMENU and WM_INITMENUPOPUP). I can't find anything either in solution explorer or the dialog editor.
2
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
I'm on 2003, but it's in the overrides (OnInitDialog()), not in the messages. MFC makes the
virtual call always so there's no need to handle the message directly
Mark
|
|
|
|
|
Ah thanks!
I wasn't aware that some message get their own vitual function.
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
The new IDE is a real pain that way. I generally end up adding stuff by hand.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
My recent 5-part article describes how. Go here and go about 3/4's down the page to find it.
http://www.codeproject.com/samples/SDIMultiSplit_Part1.asp[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You are not very encouraging
In my hunt I came across the "Add function" wizard - this is just the most terribly overcoded underengineered dialog just after the function wizard you get from a n00b. My eyes hurt.
[edit]this is a reply to Christian graus...[/edit]
Developers, Developers, Developers, Developers, Developers, Developers, Velopers, Develprs, Developers! We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP Linkify!|Fold With Us!
|
|
|
|
|
peterchen wrote: In my hunt I came across the "Add function" wizard - this is just the most terribly overcoded underengineered dialog just after the function wizard you get from a n00b. My eyes hurt.
What about Variable Adding Dialog Box.. while adding Cntl variable for each control on Dialog Box... it really big pain.. as you have to open it again and again
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
Hy, since I'm new to MFC/C++ programming, I could really appreciate some help.
So can someone please explain to me what function should I use if I wanted to change the color of the dynamic (input) text that user enters? The user should be able to select the color he wants.
Thanks
Alessandra
|
|
|
|
|
You can add a WM_CTLCOLOR handler to your window/dialog class and in your handler method, use
SetTextColor() to set the color for edit control(s). The background color can also be set.
Something like this:
HBRUSH CMyWnd::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CWnd::OnCtlColor(pDC, pWnd, nCtlColor);
if (nCtlColor == CTLCOLOR_EDIT)
{
pDC->SetTextColor(RGB(0x00,0xFF,0x00));
}
return hbr;
}
To let the user pick a color you could use the color-picker common dialog (the MFC CColorDialog
class wraps it). Store the COLORREF picked by the user and use it in place of the
"RGB(0x00,0xFF,0x00)" in the code above.
Mark
|
|
|
|
|
Thanks
Alessandra
|
|
|
|
|
can someone help in some way i could monitor un EXE stack and read the respective handles like in real time to try to find out what is going on in the stack and what is happening in the handle system...
its a uni work to detect if un exe was changed or not, i detected a strange handle that apears with diferent names but some information is the same, but the memory where the handle is located it changes each time i run the 2nd prog that changes the 1st prog..
someone could help me with a doc to write a smal thing in c++ to read in real time in way to monitor a exe stack and handles..
someone could help what means size of a handle: 0x0001e000 (???) in size this is what ?
|
|
|
|
|
no one ???
|
|
|
|
|
I'm not sure what you want to look at on the stack. automatic variables? Return pointers?
That's all that's there that is useful info. If you use the disassembly window while debugging
you can see how compiled code is manipulating the stack. My assembly skills are too rusty to
provide any sample code
What kind of handles are you referring to? Operating system handles like HWND, HANDLE, etc.?
OS handles in Windows are opaque - they have no meaning to the user except that they represent
some object in the system. You can't, as a programmer, make any assumptions about the type
or contents of a handle. A handle could be a simple value, a structure, a pointer to a structure,
an index, etc.
You asked about the size of a handle. What do you need to know? The size of a HANDLE object?
Mark
|
|
|
|
|
thanks for your reply..
what i mean to read in the handle, is sections is the most important, and then mutant, file and events..
about the stack, i need to know the stack information about a thread thats is running with the EXE. for example a thread stack:
ntkrnlpa.exe!KiUnexpectedInterrupt+0xf0
win32k.sys+0x2fa0
win32k.sys+0x37a6
win32k.sys+0x37c3
ntdll.dll!KiFastSystemCallRet
firefox.exe!JVM_GetJSSecurityContext+0x2d9e6
firefox.exe+0x1012
kernel32.dll!RegisterWaitForInputIdle+0x49
i need to monitor the stack of this thread in way to monitor...
when i mean about the size of 0x0001e000 is that because i dont know what means all that number "0x0001e000" i dont have a clue...
thanks for the help would be apreciate, im looking more for a tuturial that could explain how to work with threads and handles read this kind of information from a file
|
|
|
|
|
I'm not sure about the stack stuff, but handles I can help with.
van-ux wrote: when i mean about the size of 0x0001e000 is that because i dont know what means all that number "0x0001e000" i dont have a clue...
My previous point was that it's not for you to know. It's not documented and Microsoft can choose
to change what it represents at any time. You may find some documentation online about certain
Windows handles but it's really not useful - it can change at any time.
"0x0001e000" is probably an address...but maybe it's an index. Maybe it's bit flags.
Handles and Objects[^]
DLLs, Processes, and Threads[^]
|
|
|
|
|
thanks for the links m8, i have a look, and i have something to read now thanks
btw i saw that handles are contained inside the objects, and the objects contain all information about the handles asuel... you know a good tuturial or book that could help me in this case just by chance, otherwise i will google it...
the book i mean for programming...
thanks great post
|
|
|
|
|
van-ux wrote: you know a good tuturial or book that could help me in this case just by chance, otherwise i will google it...
I don't know of any specific titles offhand, sorry
|
|
|
|
|
I am trying to change font size in an edit box with the following code. There seems to be a limit on the size I can get, regardless of the params in font.CreatePointFont . The max seems to be about 14 point bold. How can I get a larger size?
CFont font;<br />
font.CreatePointFont(920, "Garamond");<br />
CFont *pFont = (&font);<br />
GetDlgItem(IDC_EDIT_Utility)-> SetFont(pFont, TRUE);
|
|
|
|
|
How are you checking to see if you get the requested size?
You could try checking the created font to see the attributes of the created font:
CFont font;
font.CreatePointFont(920, "Garamond");
LOGFONT logfont;
font.GetLogFont(&logfont);
Is that the way you've coded to create the font? If so, if "font" goes out of scope then the
fonts handle (HFONT) is destroyed.
Mark
|
|
|
|
|
Hi,
I have created a SDI with FormView. The data from the view can be stored into a file and when the file is clicked, it opens directly into the formview with the edit boxes automatically filled.
Now, when one file/document is open, if the user selects File-New from the menu, a new document opens and all the fields on the Form get reset (set to zero). The previously open document gets closed.
I would like to ask the user if he would like to save the data before opening a new document.
I have put this option when the Exit button is clicked, but am not able to figure out how to open a new document after the saving process is over.
Please help!
Fortitudine Vincimus!
|
|
|
|
|
Override CDocument::OnCloseDocument().
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
AH!! This works ... Is it the correct way?
I added this in the MainFrame Class:
void CMainFrame::OnFileNew()
{
CSFPAView *pFV = (CSFPAView *)GetActiveView();
if (pFV->DoBeforeExit())
{
CSingleDocTemplate * pTemplate = (CSingleDocTemplate *) GetActiveDocument()->GetDocTemplate();
pTemplate->OpenDocumentFile(NULL);
}
}
Fortitudine Vincimus!
|
|
|
|
|
Tara14 wrote: I would like to ask the user if he would like to save the data before opening a new document.
If the document contents have not changed, no prompt is necessary. Otherwise, look at the SetModifiedFlag() method.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello everybody. Recently I coded a client-server application and put it in the start up folder. Everything works perfect except for the log file. The problem is this: When the computer starts up the log file opens fine according to file.is_open(), however, nothing gets written to the file. This only happens on start up. If I open it myself the log file works fine and records everything. But when placed in the startup folder to open itself it fails??? What could be the problem?? This has been annoying me forever and any help would be appreciated. Thanks in advance everybody!!
by the way: using windows XP, VC++ 7
-- modified at 16:01 Tuesday 6th February, 2007
|
|
|
|