|
Hello ,
Iam doing a MFC project.Iam displaying Animated GIFs with CDhtmlDialog class.This method works but the problem is that it works like a IE explorer.FOr example ,if i right click on the image a menu appears which is same as the IE right click menu .
Is there a way to get rid of this menu and similar such default IE message handlers??
|
|
|
|
|
I've never used VC++NET and I don't know if it is the same, but in a HTML Web page you can weite down this and the popup disappears...
<html><body oncontextmenu="return false"> ...
Hope this helps...
|
|
|
|
|
ACtually iam dispaling images here .ANyway i wil try ur suggestion .Thanks for it .
I solved it by getting the child window and disabling the user input to it !!!( Wnd->Enable Window(FALSE))
|
|
|
|
|
I'm having a little problem with trying to use one app to get two GDI+ windows up. I am using MFC.
I was origonally initializing GDI+ graphics as ::
Graphics graphics(::GetDC(m_hWnd));
And whenever two GDI+ screens overlapped, one would not reprint however, mouse movements on that window would still work). I changed the above to :::
CPaintDC dc(this);
Graphics graphics(dc.m_hDC);.
And right now, both screens are active, meaning if I move one over the next, both would reprint, however, they would not reprint on command, meaning that if I move my mouse over a button, it would internally change the variable to highlight, but the display would not get displayed.
Using method # 1, displays the graphics whenever possible, but using #2 only displays it on a window resize... I am putting the code inside the OnPaint function.
Any ideas? I have no idea why the behavior is different. Can one app have two GDI+ windows constantly repainting? I am using CS_OWNDC.
Thanks for the suggestions!
|
|
|
|
|
Hi All,
I need to integrate MapPoint software into my MFC database application. Basically what i want to acheive is to
get the data from the database and display it in the map. Application has to invoke the map and draw the route on it.
Any ideas will be appreciated.
Thanks,
John
|
|
|
|
|
Using the MFC AppWizard in Visual C++ 6.0 I created an SDI app with CRichEditView as the base class, and included the standard printing and print preview options. When printing or using the print preview, the text is always formatted for 8-1/2 x 11 paper oriented portrait, regardless of what is selected for these options in the print setup. For example, if landscape orientation is requested, the text is printed landscape, but it is formatted too narrow for the page, and it runs off the bottom of the page. What do I need to do so that the printable area is resized when the print setup options change?
|
|
|
|
|
Did you consider having a look in the wordpad example source?
I guess you may find it here. wordpad is yust a RichEditView.
G. Steudtel
|
|
|
|
|
I had looked at the code for the WordPad example, but I couldn't isolate the problem. I found that if I commented out the line
theApp.NotifyPrinterChanged();
from CWordPadView::OnPageSetup() it acted the same as what I have described. I can't seem to trace the cause of this behavior.
|
|
|
|
|
Hi,
the problem is not so hard to solve. You found all the footprint of the path to follow, except for the last.
If you have a close look at the source, you will find it sends a message m_nPrinterChangedMsg which will be intercepted eventually by the wordpadview class (CWordPadView).
In here a new device context for the printer is created and passed to the CRichEditView via OnPrinterChanged.
Having then a look at the help for CRichEditView::OnPrinterChanged reveals, that by default the printing will be on a paper of size 8.5" to 11".
So all you have to do, is create a printer device context, and send it to your CRichEditView.
You must destroy this printer device after printing. See CWinApp::CreatePrinterDevice .
You see, you found the place, where to start searching, and just stopped a millimeter before reaching the goal.
Never give up to early.
Regards
G. Steudtel
|
|
|
|
|
Thanks. I am new to Visual C++, so the MFC things are difficult for me to understand and trace through. I'll try to implement what you have described. Thanks again.
|
|
|
|
|
Hello,
how can I convert a CString to an int?
For char pointer strings this is easy (using the atoi function), but how to do it with CString?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi, try this
Cstring str;
str="4711";
int number = atoi(str.GetBuffer(str.GetLength()));
|
|
|
|
|
Works perfectly. Thanks!!!
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Don't use GetBuffer() and GetLength(). just use atoi() and cast the cstring to const char * (optional)
#include <beer.h>
|
|
|
|
|
There's no need to use GetBuffer() or GetLength().
|
|
|
|
|
I normaly convert direkt too, but in a former case i had a problem with that so i thought this would be the save way
|
|
|
|
|
why not just int number = atoi(str); ?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
I'm trying to adapt the size of window so it can fit with different resolutions based on the monitor size?
|
|
|
|
|
dc.GetDeviceCaps(HORZRES)
dc.GetDeviceCaps(VERTRES)
will tell you the size of the display
-c
|
|
|
|
|
Can I do the following in the OnDraw function?
CRect rc;
SystemParametersInfo(SPI_GETWORKAREA,0,rc,0);
|
|
|
|
|
yes, but don't.
OnDraw is called pretty much all the time, and you don't want to do things in the OnDraw function that will cause drawing to be required (such as resizing the window) - that leads to trouble.
-c
|
|
|
|
|
If I use this method, will it matter which function I put this in?
dc.GetDeviceCaps(HORZRES)
dc.GetDeviceCaps(VERTRES)
All I need to adapt to different resolutions is to GetDeviceCaps?
What is dc?
Thank's.
|
|
|
|
|
Hi
How can I change screen resolution or color depth(etc.) using MFC ??
Thanks
|
|
|
|
|
Search codeproject for "Easily change screen resolution".
Trust in the code Luke. Yea right!
|
|
|
|