|
See some code in this page (section Dialog&Windows)
http://www.codeproject.com/dialog/wizard2000.asp
Hung Son
A Vietnamese student
i-g.hypermart.net
dlhson2001@yahoo.com
|
|
|
|
|
The actual window control(s) are not created until you are on that page. Therefore, pull the data from member variables.
|
|
|
|
|
' anyone know if it is possible to use DirectDraw in windowed mode in a MFC application ?
What i would like to do is some graphic stuff whiere things could be triggered by the user clicking on buttons for example.
RaGe
|
|
|
|
|
The wgl* functions act on rendering context which is initialized
as
HGLRC wglCreateContext(
HDC hdc // device context of device that the rendering context
// will be suitable for
);
so you need to initialize the rendering context and continue doing
your directdraw, and release the hdc when the window is getting destroyed.
|
|
|
|
|
The wgl* functions are for OpenGL, which is completely separate from DirectDraw.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Why yes it is possible.
In fact, if you have the DirectX 8.1 SDK, there are a ton of sample programs included on this disk, three of which are MFC specific examples. Also, there is a base framework that you can use to develop MFC applications in both windowed and full screen mode.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Actually , I´m running my application under windows NT 4.0, but i´ve have not find any directX 8.1 SDK running under this OS ( for sure i´m such a lame i did not understand how the microsoft download "search" works ). In my MSDN (6.0), there is only a few examples running in Win32 apllication but without MFC (Well, MSDN and DirectX 8.1 SDK are not the same thing, I know) ... Meantime, I actually managed to display something even if it is still not what i want, but i´m sure it will eventually work
Anyway, thanks for your help.
RaGe
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
|
|
|
|
|
Rage wrote:
Unfortunately, brute-force solutions tend to be slow
even when performed by modern-day microcomputers,
which are capable of several MIPS except when I'm late
for an appointment and want to finish a compile and
run just one more test before I leave, in which case
the crystal in my computer is apparently designed to
automatically revert to 1 Hz.
-- Michael Abrash
anybody who quotes michael abrash is cool by me
"... and so i said to him ... if it don't dance and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I'm able to load a bitmap into a HBITMAP. I want to put that HBITMAP on a CStatic control. Does anybody know the steps to take to make that happen?
Thanks
|
|
|
|
|
Look at
CStatic::SetBitmap and LoadImage
Michael
|
|
|
|
|
Sorry, I guess I should have also noted that I was able to get this far. The last piece is to resize the bitmap to the size of the CStatic control. Do you know how to do that?
Thanks
|
|
|
|
|
You will have to create a second bitmap that is the size of your CStatic control, as well as two memory DCs to select your HBITMAPs into, then use StretchBlt to adjust the size of your first bitmap. When this is done, destroy your memory DCs, and you will have two HBITMAPs.
One that is the original HBITMAP, and the second that is the same size as the CStatic control. This is the bitmap that you want to use to set to your control.
Good Luck.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
In my application, I get the ID of another process, and I'd like to get all the handles owned by this extern process. Does anybody know how to proceed ?
Thanks,
Robin.
|
|
|
|
|
is there a way to set the max size that a program/dialog can open. example 800x600. my application is an mdi app.
thank you.
|
|
|
|
|
Try to catch the WM_SIZE message and from there call SetWindowPos function to set a maximum size of your frame windows
Best regards,
Alexandru Savescu
|
|
|
|
|
The WM_SIZE is sent after the size has been changed, so
you will get a flicker if you resize then.
|
|
|
|
|
If you are looking at restricting even if the user wants to resize the appilcation
to maximum size, you should not probably, in this case only dialogs can help.
But if you want a work around for this probably
indicating a thin border for your FrameWnd and explicitly
disabling the System Menu SC_MAXIMIZE might help.
|
|
|
|
|
Check WM_GETMINMAXINFO in MSDN.
Magnus
|
|
|
|
|
You will want to use the WM_GETMINMAXINFO message. The OS will send this message to your window right before it is to be resized, and this is your windows chance to tell the OS the smallest size that the user can drag the window to and the largest that they can resize the window to.
This message will also allow you to determine the maximized position dimensions. You can force a maximized window to only take up a small portion of the screen, and you can set the position of that reduced size window when the window is maximized. Look at FreeCell in the accesories folder for a demonstraction of this.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
I know the syntax of both of these functions but can't find any place in the MS literature where it states when one should be used in lieu of the other.
From what I've been able to discern with tests it appears as though I should I use SetAbortProc to handle print spooling errors and AbortDoc to handle user cancellation. Anyone know for sure?
Cheers,
Tom Archer
Author - Inside C#, Visual C++.NET Bible
|
|
|
|
|
You are the author of two books and are asking us for help? Will I get royalties if I answer your question? We should be emailing you with questions...
The AbortDoc method and the abort proc function are two different things. If you look at the CView::OnFilePrint() method in the MFC you can see how both are used. The SetAbortProc method is use by the print manager to set a call back function. This call back (abort proc) gets called to check if the use wants to cancel (abort) the print. If the use does then the AbortDoc method is called.
For standard MFC printing OnFilePrint method will call the abort proc between printing each page. This _AfxAbortProc(HDC, int) function will check and see if the cancel button has been pressed.
Why use SetAbortProc? The default print stuff works well for most multipage printing. But, what if your print is only one page long and takes a long time to render to the printer? You may what to create your own OnFilePrint and abort proc that will allow the user to cancel the print. Creating you own also allows you to use a custom dialog during printing. Say, one that shows the precentage complete instead of the page being printed.
Note that the abort proc also get called for internal printing errors and out-of-memory or out-of-disk conditions.
See MSDN for:
Callback Function for CDC::SetAbortProc
CDC::SetAbortProc
and MFC source Viewprnt.cpp:
CView::OnFilePrint()
class CPrintingDialog : public CDialog
BOOL CALLBACK _AfxAbortProc(HDC, int)
Hope this helps...
Good luck with the books!
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
I would like to know if someone knows (of course someone knows but...) how to place all types of fonts on a combo box. The language is Visual C++.
I can add those combo boxes but still don't know how to make them have the font types or in the second combo box the size of the text.
My project objective is to do a mini-word
|
|
|
|
|
Chris Losinger has a font combo box class on CP. Search for it
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
How do I search for that???? I'm a little rookie on this ... btw, what is CP? (go easy on me!!!)
|
|
|
|
|
Never mind... CP = Code Project (right?)
I've got it thanks
|
|
|
|