|
i write a activex and want to use it in word,and i want to capture the DocumentBeforePrint event so that i can prevent the word doc to be printed.what can i do?
|
|
|
|
|
My dialog program will start another dialog by pressing a button
Cxx dlg
dlg.DoModal();
In the Cxx dialog, I will create font by doing this
//Cxx.h
CFont m_font1;
//Cxx.cpp
//BOOL Cxx::OnInitDialog()
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
lf.lfHeight = 25; // Request a 25-pixel-high font
lf.lfWeight = 700;
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
m_font1.CreateFontIndirect(&lf); // Create the font.
The problem is that when I try to start the Cxx dialog second time.
The program will get error in creating the m_font1 again.
Please help!
|
|
|
|
|
|
Is it possible to destroy it.
Please help!
|
|
|
|
|
LaHaHa wrote: Is it possible to destroy it.
Yeah
m_font1.DeleteObject();
LaHaHa wrote: Please help!
My Pleasure
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Thank you very much!
I got it!
|
|
|
|
|
Hi
I want to ask you one think. How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
We Believe in Excellence
|
|
|
|
|
This is a pretty general question. All UI elements are ultimately a window, and so ultimately they are all created using the same Win32 underlying function. Beyond that, any fancy controls probably draw themselves.
System Works is definately a bunch of owner drawn controls.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Aqueel wrote: How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
They do the drawing by themselves. You can do the same way too. But you have to take care of all aspects of the drawing.
Even the dialog boxes, frame, mdi windows, etc that appear are drawn somewhere that's why they appear the way they do.
For example you can take ownerdrawn(not me) buttons, listboxes, comboboxes etc.
The guys who are involved in this type of work are experts.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Owner drawn wrote: For example you can take ownerdrawn(not me)
lol
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 1:24 Thursday 12th January, 2006
|
|
|
|
|
Aqueel wrote: How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
this will good start for evry thing http://www.codeproject.com/script/articles/subcat.asp?id=3[^]
"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
|
|
|
|
|
|
Try subclassing it and overriding the WM_CONTEXTMENU[^] message.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
no MFC! how can i find common control tutorials for C++ like their are for C#
|
|
|
|
|
on the main page check the left bar.
-Prakash
|
|
|
|
|
nope, i see C# Controls and MFC Controls but no were can i find something like those for C++ Win32
|
|
|
|
|
Gamer-Owned wrote: nope, i see C# Controls and MFC Controls but no were can i find something like those for C++ Win32
MFC is just a wrapper over win32, you can pretty much do everything what MFC control does.
-Prakash
|
|
|
|
|
i found http://www.codeproject.com/dialog/
randomly cut look on the sidebar and everything and couldnt find it there i mean, its a wealth of what i was looking for the fact i randomly found it was lucky, i got it from a link from a C# tutorial. can anyone tell me how to navigate to this? (All Topics, MFC / C++ >> Dialog and Windows)
|
|
|
|
|
If you can't see the link along the left side of the main page, change your view in the middle of the page to be MFC, or all.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I dont see a windows version of valgrind. Is there any such memory leak/corruption detection tools that work with just the binaries(as opposed to source code)?
thanks!
|
|
|
|
|
With "Debugging Tools For Windows" - The debugging tools from Microsoft. It contains a utility called "UMDH" can be used find leaks and the like in vanilla binaries.
Steve
|
|
|
|
|
I'm trying to work with a RichEdit, and the code looks like this:
chat_window_rich.SetSel(nLength, nLength);
chat_window_rich.SetSelectionCharFormat(cf);
chat_window_rich.ReplaceSel(buff);
I don't want the edit window to automatically scroll to the bottom when a user is trying to scroll up and look at previously added text. For some reason, whenever a user has clicked in the edit window and a new chat message is received, the window is automatically scrolled to the bottom.
There are no calls to any scrolling functions anywhere.
If the user has scrolled up in the chat window but has clicked in some other window, for instance the typing window, the chat will NOT automatically scroll, it only happens when the mouse focus is on the window.
Anyone know what's wrong or how I can fix?
Kelly Ryan
|
|
|
|
|
I'm no rich edit expert (I've never used one) but the general solution to this problem (you need to call a method that scrolls the window but you don't want the scrolling) is to turn off redraw using WM_SETREDRAW (which MFC wraps with CWnd::SetRedraw ), call the functions you like, restore the position to where you want it then re-enable redraw. Not pretty but I've had to resort to this technique before.
There may be some easy way in this case however.
Steve
|
|
|
|
|
I gave it a try, I can set the scrollbar in the right position but I can't get the darned window to scroll accordingly... ScrollWindow messages just don't seem to affect it, WM_VSCROLL messages don't affect it.. it just won't move.
Is there an easy way I can just tell it to set itself to the position dictated by its scrollbar?
Kelly Ryan
|
|
|
|
|
I believe the EM_SETSCROLLPOS and EM_GETSCROLLPOS are what you're after.
Steve
|
|
|
|